Versions in this module Expand all Collapse all v0 v0.1.11 Nov 26, 2026 v0.1.10 Nov 23, 2026 v0.1.9 Nov 21, 2026 v0.1.8 Nov 20, 2026 Changes in this version type Stylesheet + func ParseParts(parts ...string) (*Stylesheet, error) v0.1.7 Nov 14, 2026 v0.1.6 Nov 13, 2026 v0.1.5 Nov 12, 2026 v0.1.4 Nov 11, 2026 v0.1.3 Nov 9, 2026 v0.1.2 Nov 9, 2026 Changes in this version + func Match(selector Selector, node *dom.Node) bool + func MatchWithState(selector Selector, node *dom.Node, state *State) bool + func MatchWithStateAndContext(selector Selector, node *dom.Node, state *State, ctx *MatchContext) bool + func ScopeStylesheet(input, className string) (string, error) + func SplitImportant(input string) (string, bool) + func StripComments(input string) (string, error) + type AttributeSelector struct + CaseInsensitive bool + Name string + Operator string + Value string + type CompoundSelector struct + Attributes []AttributeSelector + Classes []string + ID string + PseudoClasses []PseudoClass + Tag string + func (c CompoundSelector) String() string + type Declaration struct + Important bool + Property string + Value string + type Keyframe struct + Declarations []Declaration + Offsets []float64 + type Keyframes struct + Conditions []RuleCondition + Frames []Keyframe + Name string + func (k Keyframes) String() string + type MatchContext struct + func NewMatchContext() *MatchContext + func (c *MatchContext) Reset() + type PseudoClass struct + Name string + Selectors []Selector + Value string + type Rule struct + Conditions []RuleCondition + Declarations []Declaration + Selectors []Selector + func (r Rule) String() string + type RuleCondition struct + Kind RuleConditionKind + Prelude string + type RuleConditionKind int + const RuleConditionContainer + const RuleConditionMedia + type Selector struct + Parts []CompoundSelector + func (s Selector) HasSiblingCombinator() bool + func (s Selector) String() string + type Specificity struct + Class int + ID int + Tag int + func CalculateSpecificity(selector Selector) Specificity + type State struct + Active *dom.Node + FocusVisible bool + Focused *dom.Node + Hovered *dom.Node + type Stylesheet struct + Keyframes []Keyframes + Rules []Rule + func Parse(input string) (*Stylesheet, error) + func (s Stylesheet) String() string + type Token struct + Type TokenType + Value string + type TokenType int + const TokenAtKeyword + const TokenColon + const TokenComma + const TokenDelim + const TokenDot + const TokenEOF + const TokenHash + const TokenIdent + const TokenLBrace + const TokenLBracket + const TokenRBrace + const TokenRBracket + const TokenSemicolon + const TokenString + const TokenWhitespace + type Tokenizer struct + func NewTokenizer(input string) *Tokenizer + func (t *Tokenizer) Next() (Token, error) + func (t *Tokenizer) Peek() (Token, error) + func (t *Tokenizer) ReadDeclarationValue() string