tss

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Comment parse.TokenKind = iota
	LBrace
	RBrace
	LBracket
	RBracket
	Equals
	Colon
	Comma
	Semicolon
	Star
	Dot
	Dollar
	Slash
	Color
	Ident
	Number
	String
)

Variables

This section is empty.

Functions

func BuildStyle

func BuildStyle(sheet Sheet) (*style.Style, event.Cookie, error)

BuildStyle builds a Tomo style from the specified sheet. Resources associated with it (such as textures) can be freed by closing the returned cookie.

func Lex

func Lex(filename string, reader io.Reader) parse.Lexer

func LoadFile

func LoadFile(name string) (*style.Style, event.Cookie, error)

LoadFile loads the stylesheet from the specified file. This may return a parse.Error, so use parse.Format to print it.

Types

type Rule

type Rule struct {
	Selector Selector
	Attrs    map[string][]ValueList
}

type Selector

type Selector struct {
	Package string
	Object  string
	Tags    []string
}

type Sheet

type Sheet struct {
	Path      string
	Variables map[string]ValueList
	Rules     []Rule
	// contains filtered or unexported fields
}

func Parse

func Parse(lexer parse.Lexer) (Sheet, error)

func (*Sheet) Flatten

func (this *Sheet) Flatten() error

Flatten evaluates all variables recursively, thereby eliminating all instances of ValueVariable.

type Value

type Value interface {
	// contains filtered or unexported methods
}

type ValueColor

type ValueColor uint32

func (ValueColor) RGBA

func (value ValueColor) RGBA() (r, g, b, a uint32)

type ValueCut

type ValueCut struct{}

type ValueKeyword

type ValueKeyword string

type ValueList

type ValueList []Value

type ValueNumber

type ValueNumber int

type ValueString

type ValueString string

type ValueVariable

type ValueVariable string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL