Documentation
¶
Index ¶
- func BuildDictWriteSheet(d *tokens.StringDict, node directives.Node) (string, error)
- func BuildFile(input string, outputPath string) error
- func SaveMathFont(dst string) error
- func WriteSheetToFile(s Sheet, path string) error
- type AtRule
- type AtRuleGen
- type AtSelector
- type AttrFilter
- type AttrFilterData
- type ContainsAttrFilter
- type ExactAttrFilter
- type FieldAttrFilter
- type GenericPseudoClass
- type PlainAttrFilter
- type PrefixAttrFilter
- type PseudoClass
- type Rule
- func ExpandAtRules(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewMediaRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewPageRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewSupportsRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewWrapRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- func NewWrapSiblingsRule(sel Selector, key *tokens.String, attr *tokens.StringDict) ([]Rule, error)
- type RuleData
- type Selector
- type SelectorData
- type Sheet
- type SheetData
- type SubcodeAttrFilter
- type SuffixAttrFilter
- type WrapRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDictWriteSheet ¶
func BuildDictWriteSheet(d *tokens.StringDict, node directives.Node) (string, error)
func SaveMathFont ¶ added in v0.4.1
func WriteSheetToFile ¶
Types ¶
type AtRule ¶
type AtRule struct {
// contains filtered or unexported fields
}
func NewAtRule ¶
func NewAtRule(sel *AtSelector, rules []Rule) *AtRule
func (*AtRule) ExpandNested ¶
not called the first time. The subsequent times nothing should change
func (*AtRule) SetParent ¶
func (r *AtRule) SetParent(parent *AtSelector)
type AtSelector ¶
type AtSelector struct {
// contains filtered or unexported fields
}
at rules can be endlessly deeply nested
func NewAtSelector ¶
func NewAtSelector(key *tokens.String) *AtSelector
func (*AtSelector) SetParent ¶
func (s *AtSelector) SetParent(parent *AtSelector)
func (*AtSelector) Write ¶
func (s *AtSelector) Write() string
type AttrFilter ¶
type AttrFilter interface { Match(attr *tokens.StringDict) bool Write() string }
func ParseAttrFilter ¶
func ParseAttrFilter(t_ raw.Token) (AttrFilter, error)
type AttrFilterData ¶
type AttrFilterData struct {
// contains filtered or unexported fields
}
type ContainsAttrFilter ¶
type ContainsAttrFilter struct {
AttrFilterData
}
func NewContainsAttrFilter ¶
func NewContainsAttrFilter(name string, value string, ci bool) *ContainsAttrFilter
func (*ContainsAttrFilter) Match ¶
func (f *ContainsAttrFilter) Match(attr *tokens.StringDict) bool
func (*ContainsAttrFilter) Write ¶
func (f *ContainsAttrFilter) Write() string
type ExactAttrFilter ¶
type ExactAttrFilter struct {
AttrFilterData
}
func NewExactAttrFilter ¶
func NewExactAttrFilter(name string, value string, ci bool) *ExactAttrFilter
value should be in quotes in the final code
func (*ExactAttrFilter) Match ¶
func (f *ExactAttrFilter) Match(attr *tokens.StringDict) bool
func (*ExactAttrFilter) Write ¶
func (f *ExactAttrFilter) Write() string
type FieldAttrFilter ¶
type FieldAttrFilter struct {
AttrFilterData
}
func NewFieldAttrFilter ¶
func NewFieldAttrFilter(name string, value string, ci bool) *FieldAttrFilter
func (*FieldAttrFilter) Match ¶
func (f *FieldAttrFilter) Match(attr *tokens.StringDict) bool
func (*FieldAttrFilter) Write ¶
func (f *FieldAttrFilter) Write() string
type GenericPseudoClass ¶
type GenericPseudoClass struct {
// contains filtered or unexported fields
}
func NewGenericPseudoClass ¶
func NewGenericPseudoClass(name string) *GenericPseudoClass
func NewGenericPseudoClassWithArgs ¶
func NewGenericPseudoClassWithArgs(name string, args string) *GenericPseudoClass
func (*GenericPseudoClass) Write ¶
func (p *GenericPseudoClass) Write() string
type PlainAttrFilter ¶
type PlainAttrFilter struct {
AttrFilterData
}
func NewPlainAttrFilter ¶
func NewPlainAttrFilter(name string) *PlainAttrFilter
func (*PlainAttrFilter) Match ¶
func (f *PlainAttrFilter) Match(attr *tokens.StringDict) bool
func (*PlainAttrFilter) Write ¶
func (f *PlainAttrFilter) Write() string
type PrefixAttrFilter ¶
type PrefixAttrFilter struct {
AttrFilterData
}
func NewPrefixAttrFilter ¶
func NewPrefixAttrFilter(name string, value string, ci bool) *PrefixAttrFilter
func (*PrefixAttrFilter) Match ¶
func (f *PrefixAttrFilter) Match(attr *tokens.StringDict) bool
func (*PrefixAttrFilter) Write ¶
func (f *PrefixAttrFilter) Write() string
type PseudoClass ¶
type PseudoClass interface {
Write() string
}
func ParsePseudoClass ¶
func ParsePseudoClass(ts []raw.Token) (PseudoClass, error)
type Rule ¶
type Rule interface { ExpandNested() ([]Rule, error) // includes self as first //ExpandLazy(root *tree.Root) ([]Rule, error) // modifies the root!, adding rules, but keeping all the originals untouched, any remaining lazy values are ignored in the core rule output Write(indent string, nl string, tab string) (string, error) }
func ExpandAtRules ¶
sel == nil is toplevel at rule
func NewMediaRule ¶
func NewPageRule ¶
func NewSupportsRule ¶
func NewWrapRule ¶
func NewWrapSiblingsRule ¶
type RuleData ¶
type RuleData struct {
// contains filtered or unexported fields
}
func (*RuleData) ExpandNested ¶
type Selector ¶
type SelectorData ¶
type SelectorData struct {
// contains filtered or unexported fields
}
func ParseSelector ¶
func ParseSelector(ts []raw.Token) (*SelectorData, error)
func (*SelectorData) Copy ¶
func (s *SelectorData) Copy() *SelectorData
func (*SelectorData) Extend ¶
func (s *SelectorData) Extend(extra *tokens.String) ([]Selector, error)
func (*SelectorData) Write ¶
func (s *SelectorData) Write() string
type Sheet ¶
type Sheet interface { Append(r Rule) IsEmpty() bool Len() int //IsNotLazy() bool Write(compr bool, nl string, tab string) (string, error) ExpandNested() (Sheet, error) // expanding a second time does nothing ApplyExtensions(root *tree.Root) (*tree.Root, error) }
type SheetData ¶
type SheetData struct {
// contains filtered or unexported fields
}
func (*SheetData) ApplyExtensions ¶
func (*SheetData) ExpandNested ¶
type SubcodeAttrFilter ¶
type SubcodeAttrFilter struct {
AttrFilterData
}
func NewSubcodeAttrFilter ¶
func NewSubcodeAttrFilter(name string, value string, ci bool) *SubcodeAttrFilter
func (*SubcodeAttrFilter) Match ¶
func (f *SubcodeAttrFilter) Match(attr *tokens.StringDict) bool
func (*SubcodeAttrFilter) Write ¶
func (f *SubcodeAttrFilter) Write() string
type SuffixAttrFilter ¶
type SuffixAttrFilter struct {
AttrFilterData
}
func NewSuffixAttrFilter ¶
func NewSuffixAttrFilter(name string, value string, ci bool) *SuffixAttrFilter
func (*SuffixAttrFilter) Match ¶
func (f *SuffixAttrFilter) Match(attr *tokens.StringDict) bool
func (*SuffixAttrFilter) Write ¶
func (f *SuffixAttrFilter) Write() string
type WrapRule ¶
type WrapRule struct {
// contains filtered or unexported fields
}
@wrap and @wrap-siblings are special at-rules that insert <div id=... class=.....> tags into the tree they do this before the other rules are evaluated TODO: as js query to combine with cross-lang template import in js, must be runtime because we don't know where template might be injected, all wrap statements must be executed? only @wrap can have runtime js equivalent, @wrap-siblings not
func (*WrapRule) ExpandNested ¶
Click to show internal directories.
Click to hide internal directories.