Documentation
¶
Overview ¶
Package cssparse provides the small, bounded CSS rule/declaration parser shared by Paper's HTML and SVG renderers. It intentionally models the stylesheet surface Paper consumes instead of attempting browser-complete CSS.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitSelectors ¶
SplitSelectors splits a selector list on only top-level commas. It keeps selector text (including escapes and function/attribute contents) intact.
func StripImportantSuffix ¶
StripImportantSuffix removes a trailing `!important` from a declaration value. It reports whether the suffix was there.
Types ¶
type Declaration ¶
Declaration is one `property: value` pair, and whether it ended in `!important`.
type Rule ¶
type Rule struct {
Kind RuleKind
Name string
Prelude string
Selectors []string
Declarations []Declaration
Rules []*Rule
}
Rule is a parsed CSS rule. A qualified rule uses Selectors and Declarations; an at-rule uses Name and Prelude, and may nest further Rules.