package inliner
import "github.com/aymerick/douceur/inliner"
Index ¶
- func ComputeSpecificity(selector string) int
- func Inlinable(selector string) bool
- func Inline(html string) (string, error)
- type Element
- type ElementAttr
- type Inliner
- type StyleDeclaration
- func NewStyleDeclaration(styleRule *StyleRule, declaration *css.Declaration) *StyleDeclaration
- func (styleDecl *StyleDeclaration) Specificity() int
- type StyleRule
Functions ¶
func ComputeSpecificity ¶
ComputeSpecificity computes style rule specificity
cf. http://www.w3.org/TR/selectors/#specificity
func Inlinable ¶
Inlinable returns true if given selector is inlinable
func Inline ¶
Inline inlines css into html document
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 Inliner ¶
type Inliner struct {
// contains filtered or unexported fields
}
Inliner presents a CSS Inliner
func NewInliner ¶
NewInliner instanciates a new Inliner
func (*Inliner) Inline ¶
Inline inlines CSS and returns HTML
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
StyleDeclaration 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
func (*StyleRule) String ¶
Returns the string representation of a style rule
Source Files ¶
element.go inliner.go style_declaration.go style_rule.go
- Version
- v0.2.0 (latest)
- Published
- Aug 27, 2015
- Platform
- windows/amd64
- Imports
- 9 packages
- Last checked
- 2 hours ago –
Tools for package owners.