Documentation ¶
Index ¶
Constants ¶
View Source
const ( INLINE_FAKE_SELECTOR = "*INLINE*" // Regular expressions borrowed from premailer: // https://github.com/premailer/css_parser/blob/master/lib/css_parser/regexps.rb NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_REGEXP = `` /* 258-byte string literal not displayed */ ELEMENTS_AND_PSEUDO_ELEMENTS_REGEXP = `(?i)((^|[\s\+\>\~]+)[\w]+|\:{1,2}(after|before|first-letter|first-line|selection))` )
View Source
const (
ELT_MARKER_ATTR = "douceur-mark"
)
Variables ¶
This section is empty.
Functions ¶
func ComputeSpecificity ¶
Computes style rule specificity
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
An HTML element with matching CSS rules
type ElementAttr ¶
type ElementAttr struct {
// contains filtered or unexported fields
}
type StyleDeclaration ¶
type StyleDeclaration struct { StyleRule *StyleRule Declaration *css.Declaration }
func NewStyleDeclaration ¶
func NewStyleDeclaration(styleRule *StyleRule, declaration *css.Declaration) *StyleDeclaration
func (*StyleDeclaration) Specificity ¶
func (styleDecl *StyleDeclaration) Specificity() int
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 }
A Qualifier Rule for a uniq selector
func NewStyleRule ¶
func NewStyleRule(selector string, declarations []*css.Declaration) *StyleRule
Instanciate a new StyleRule
Click to show internal directories.
Click to hide internal directories.