package css
import "github.com/aymerick/douceur/css"
Index ¶
- type Declaration
- func NewDeclaration() *Declaration
- func (decl *Declaration) Equal(other *Declaration) bool
- func (decl *Declaration) String() string
- func (decl *Declaration) StringWithImportant(option bool) string
- type DeclarationsByProperty
- func (declarations DeclarationsByProperty) Len() int
- func (declarations DeclarationsByProperty) Less(i, j int) bool
- func (declarations DeclarationsByProperty) Swap(i, j int)
- type Rule
- func NewRule(kind RuleKind) *Rule
- func (rule *Rule) Diff(other *Rule) []string
- func (rule *Rule) EmbedsRules() bool
- func (rule *Rule) Equal(other *Rule) bool
- func (rule *Rule) String() string
- type RuleKind
- type Stylesheet
Types ¶
type Declaration ¶
Declaration represents a parsed style property
func NewDeclaration ¶
func NewDeclaration() *Declaration
NewDeclaration instanciates a new Declaration
func (*Declaration) Equal ¶
func (decl *Declaration) Equal(other *Declaration) bool
Equal returns true if both Declarations are equals
func (*Declaration) String ¶
func (decl *Declaration) String() string
Returns string representation of the Declaration
func (*Declaration) StringWithImportant ¶
func (decl *Declaration) StringWithImportant(option bool) string
StringWithImportant returns string representation with optional !important part
type DeclarationsByProperty ¶
type DeclarationsByProperty []*Declaration
DeclarationsByProperty represents sortable style declarations
func (DeclarationsByProperty) Len ¶
func (declarations DeclarationsByProperty) Len() int
Implements sort.Interface
func (DeclarationsByProperty) Less ¶
func (declarations DeclarationsByProperty) Less(i, j int) bool
Implements sort.Interface
func (DeclarationsByProperty) Swap ¶
func (declarations DeclarationsByProperty) Swap(i, j int)
Implements sort.Interface
type Rule ¶
type Rule struct { Kind RuleKind // At Rule name (eg: "@media") Name string // Raw prelude Prelude string // Qualified Rule selectors parsed from prelude Selectors []string // Style properties Declarations []*Declaration // At Rule embedded rules Rules []*Rule // Current rule embedding level EmbedLevel int }
Rule represents a parsed CSS rule
func NewRule ¶
NewRule instanciates a new Rule
func (*Rule) Diff ¶
Diff returns a string representation of rules differences
func (*Rule) EmbedsRules ¶
EmbedsRules returns true if this rule embeds another rules
func (*Rule) Equal ¶
Equal returns true if both rules are equals
func (*Rule) String ¶
Returns the string representation of a rule
type RuleKind ¶
type RuleKind int
RuleKind represents a Rule kind
Rule kinds
func (RuleKind) String ¶
Returns string representation of rule kind
type Stylesheet ¶
type Stylesheet struct { Rules []*Rule }
Stylesheet represents a parsed stylesheet
func NewStylesheet ¶
func NewStylesheet() *Stylesheet
NewStylesheet instanciate a new Stylesheet
func (*Stylesheet) String ¶
func (sheet *Stylesheet) String() string
Returns string representation of the Stylesheet
Source Files ¶
declaration.go rule.go stylesheet.go
- Version
- v0.2.0 (latest)
- Published
- Aug 27, 2015
- Platform
- js/wasm
- Imports
- 2 packages
- Last checked
- 1 week ago –
Tools for package owners.