package css
import "github.com/aymerick/douceur/css"
Index ¶
- Constants
- 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
Constants ¶
const (
IDENT_SPACES = 2
)
Types ¶
type Declaration ¶
A parsed style property
func NewDeclaration ¶
func NewDeclaration() *Declaration
Instanciate a new Declaration
func (*Declaration) Equal ¶
func (decl *Declaration) Equal(other *Declaration) bool
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
Returns string representation with optional !important part
type DeclarationsByProperty ¶
type DeclarationsByProperty []*Declaration
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 }
A parsed CSS rule
func NewRule ¶
Instanciate a new Rule
func (*Rule) Diff ¶
Returns a string representation of rules differences
func (*Rule) EmbedsRules ¶
Returns true if this rule embeds another rules
func (*Rule) Equal ¶
Returns true if both rules are equals
func (*Rule) String ¶
Returns the string representation of a rule
type RuleKind ¶
type RuleKind int
Rule kinds
func (RuleKind) String ¶
Returns string representation of rule kind
type Stylesheet ¶
type Stylesheet struct { Rules []*Rule }
A Parsed stylesheet
func NewStylesheet ¶
func NewStylesheet() *Stylesheet
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.1.0
- Published
- Apr 15, 2015
- Platform
- js/wasm
- Imports
- 2 packages
- Last checked
- 2 hours ago –
Tools for package owners.