Skip to content

package rules

import "kaiju/markup/css/rules"

Constants

ReadingTag

iota

ReadingId

ReadingClass

ReadingChild

ReadingSibling

ReadingAdjacent

ReadingPseudo

ReadingPseudoFunction

ReadingProperty

ReadingPropertyValue

ReadingPropertyFunction

Types

PropertyValue

struct

type PropertyValue struct {
    Str  string
    Args []string
}

PropertyValue.IsFunction

func (p PropertyValue) IsFunction() bool

Rule

struct

type Rule struct {
    Property   string
    Values     []PropertyValue
    Invocation RuleInvoke
}

RuleInvoke

int

type RuleInvoke = int

const ( RuleInvokeImmediate RuleInvoke = iota RuleInvokeHover )

RuleState

int

type RuleState = int

Selector

struct

type Selector struct {
    Parts []SelectorPart
}

SelectorGroup

struct

type SelectorGroup struct {
    Selectors []Selector
    Rules     []Rule
}

SelectorGroup.AddRule

func (s *SelectorGroup) AddRule(r Rule)

SelectorPart

struct

type SelectorPart struct {
    Name       string
    Args       []string
    SelectType RuleState
}

StyleSheet

struct

type StyleSheet struct {
    Groups     []SelectorGroup
    CustomVars map[string][]string
    // Has unexported fields.
}

NewStyleSheet

func NewStyleSheet() StyleSheet

StyleSheet.Parse

func (s *StyleSheet) Parse(cssStr string)

StyleSheet.ParseInline

func (s *StyleSheet) ParseInline(cssStr string) *SelectorGroup