Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeSpecificity ¶
ComputeSpecificity computes style rule specificity
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element represents a HTML element with matching CSS rules
func NewElement ¶
NewElement instanciates a new element
type ElementAttr ¶
type ElementAttr struct {
// contains filtered or unexported fields
}
ElementAttr represents a HTML element attribute
type InlineOption ¶
type InlineOption struct { // FetchExternal, whether fetch external css file FetchExternal bool // SourceURL provide the way to convert relative url to absolute url SourceURL string // Proxy when fetch external css file, we can use squid to accelate by cache. Proxy string }
InlineOption Inline option parameter
type Inliner ¶
type Inliner struct {
// contains filtered or unexported fields
}
Inliner presents a CSS Inliner
func NewInlinerFromReader ¶
NewInlinerFromReader instanciates a new Inliner
type StyleDeclaration ¶
type StyleDeclaration struct { StyleRule *StyleRule Declaration *css.Declaration }
StyleDeclaration represents a style declaration
func NewStyleDeclaration ¶
func NewStyleDeclaration(styleRule *StyleRule, declaration *css.Declaration) *StyleDeclaration
NewStyleDeclaration instanciates a new StyleDeclaration
func (*StyleDeclaration) Specificity ¶
func (styleDecl *StyleDeclaration) Specificity() int
Specificity computes style declaration specificity
type StyleRule ¶
type StyleRule struct { // The style rule selector Selector string // The style rule properties Declarations []*css.Declaration // Selector specificity Specificity int }
StyleRule represents a Qualifier Rule for a uniq selector
func NewStyleRule ¶
func NewStyleRule(selector string, declarations []*css.Declaration) *StyleRule
NewStyleRule instanciates a new StyleRule
Click to show internal directories.
Click to hide internal directories.