Documentation ¶
Overview ¶
Package douceuradapter is a concrete implementation of interface cssom.StyleSheet.
License ¶
Governed by a 3-Clause BSD license. License file may be found in the root folder of this module.
Copyright © 2017–2022 Norbert Pillmayer <norbert@pillmayer.com>
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSSStyles ¶
type CSSStyles struct {
// contains filtered or unexported fields
}
CSSStyles is an adapter for interface cssom.StyleSheet. For an explanation of the motivation behind this design, please refer to documentation for interface cssom.StyleSheet.
func ExtractStyleElements ¶
ExtractStyleElements visits <head> and <body> elements in an HTML parse tree and searches for embedded <style>s. It returns the content of style-elements as style sheets.
func Wrap ¶
func Wrap(css *css.Stylesheet) *CSSStyles
Wrap a douceur.css.Stylesheet into CssStyles. The stylesheet is now managed by the wrapper.
func (*CSSStyles) AppendRules ¶
func (sheet *CSSStyles) AppendRules(other cssom.StyleSheet)
AppendRules appends rules from another stylesheet.
Interface cssom.StyleSheet
type Rule ¶
Rule is an adapter for interface cssom.Rule.
func (Rule) IsImportant ¶
IsImportant returns true if a style key is marked as important ("!").
func (Rule) Properties ¶
Properties returns the property keys of a rule, e.g. "margin-top"