Skip to content

package rules

import "kaiju/engine/ui/markup/css/rules"

Constants

ReadingTag

iota

ReadingId

ReadingClass

ReadingChild

ReadingSibling

ReadingAdjacent

ReadingPseudo

ReadingPseudoFunction

ReadingProperty

ReadingPropertyValue

ReadingPropertyFunction

Types

PropertyValue

struct

type PropertyValue struct {
    Str     string
    Num     float32
    Args    []string
    ArgNums []float32
}

PropertyValue.Clone

func (p *PropertyValue) Clone() PropertyValue

PropertyValue.IsFunction

func (p PropertyValue) IsFunction() bool

Rule

struct

type Rule struct {
    Property     string
    Values       []PropertyValue
    Invocation   RuleInvoke
    Sort         int
    SelfDestruct bool
}

Rule.Clone

func (r *Rule) Clone() Rule

RuleInvoke

int

type RuleInvoke = int

const ( RuleInvokeImmediate RuleInvoke = iota RuleInvokeHover RuleInvokeActive )

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, window *windowing.Window)

StyleSheet.ParseInline

func (s *StyleSheet) ParseInline(cssStr string, window *windowing.Window) *SelectorGroup