Documentation
¶
Overview ¶
Package style parses the engine's bounded inline CSS profile into typed values. It is manager-only and does not add parsing dependencies to TinyGo firmware.
Index ¶
- Constants
- Variables
- type Block
- type Computed
- func (c Computed) Color(name string) color.NRGBA
- func (c Computed) FontSize() float64
- func (c Computed) Get(name string) Value
- func (c Computed) Keyword(name string) string
- func (c Computed) Length(name string) Length
- func (c Computed) Number(name string) float64
- func (c Computed) RootFont() float64
- type Kind
- type Length
- type Metrics
- type Unit
- type Value
Constants ¶
const MaxDeclarations = 4096
Variables ¶
var ErrValue = errors.New("style: invalid or unsupported value")
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func Parse ¶
Parse consumes an inline declaration list, not selectors or a stylesheet. Parser recovery never turns invalid input into a partially applied scene. https://pkg.go.dev/github.com/tdewolff/parse/v2/css#NewParser
type Computed ¶
type Computed struct {
// contains filtered or unexported fields
}
Computed owns resolved inheritance and font metrics for one element. Layout still resolves percentages and box-relative lengths against its containing box.
type Length ¶
func ParseLength ¶
type Metrics ¶
type Metrics struct {
Containing, Font, RootFont, ViewportWidth, ViewportHeight float64
}
Metrics supplies the reference for this property, not a global percentage base. For font-size, Font is the inherited size (including root's initial size). https://www.w3.org/TR/css-values-3/#font-relative-lengths