Documentation
¶
Index ¶
- func DomRegistry() func() SheetObject
- func ToString(rule CSSRule, ts ...Transformer) string
- type CSSRule
- func CSS(rules ...CSSRule) CSSRule
- func Cond(cond string, rules ...CSSRule) CSSRule
- func Flattern(rule CSSRule) CSSRule
- func FontFace(rules ...CSSRule) CSSRule
- func If(cond bool, c CSSRule) CSSRule
- func KeyFrame(name string, rules ...CSSRule) CSSRule
- func P(key, value string) CSSRule
- func Process(rule CSSRule, ts ...Transformer) CSSRule
- func S(selector string, rules ...CSSRule) CSSRule
- type ClassMap
- type Conditional
- type Options
- type Registry
- type RuleList
- type Sheet
- type SheetObject
- type SimpleRegistry
- type SimpleRule
- type StyleRule
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DomRegistry ¶
func DomRegistry() func() SheetObject
DomRegistry returns a function that returns SheetObject that operate on real dome stylesheets.
func ToString ¶
func ToString(rule CSSRule, ts ...Transformer) string
Types ¶
type CSSRule ¶
type CSSRule interface { //we don't want users to implement this. Print(io.Writer) (int64, error) String() string // contains filtered or unexported methods }
func Process ¶
func Process(rule CSSRule, ts ...Transformer) CSSRule
Process this applies any transformation to the rule. It automatically flatterns the rule tree.
type Conditional ¶
func (Conditional) String ¶
func (c Conditional) String() string
type Sheet ¶
type Sheet struct { CLasses ClassMap // contains filtered or unexported fields }
func (*Sheet) AddRule ¶
AddRule processes the rules are returns mapping of original classnames to the generated classnames.
The resulting class map is merged with the existing classmap, so added classes can always be acced by s.Classes[className] field. The processed rules are stored in the stylesheet, note that this doesn't attach the sheet to the dom. You need to explicitly call Attach method to attach the styles to the dom.
type SheetObject ¶
type SheetObject interface { InsertRule(rule string) Detach() }
SheetObject is an interface for managing stylesheets.
type SimpleRegistry ¶
type SimpleRegistry struct { CreateSheetNode func() SheetObject // contains filtered or unexported fields }
SimpleRegistry implements Registry interface.
func NewSimpleRegistry ¶
func NewSimpleRegistry(fn func() SheetObject) *SimpleRegistry
func (*SimpleRegistry) Attach ¶
func (m *SimpleRegistry) Attach(s *Sheet)
func (*SimpleRegistry) Detach ¶
func (m *SimpleRegistry) Detach(s *Sheet)
func (*SimpleRegistry) NewSheet ¶
func (m *SimpleRegistry) NewSheet() *Sheet
type SimpleRule ¶
func (SimpleRule) String ¶
func (s SimpleRule) String() string