Expand description
Themes: colour tokens, motion timing, typography roles and CSS-like style rules.
[meta]
name = "Nordic"
extends = "monochrome"
[colors]
accent = "#38BDF8"
[style."button.primary"]
bg = "$accent"
fg = "$ink"
[style."button:focus"]
bg = "pulse($accent, $accent-2)"A theme only writes what differs from the theme it extends. Style rules match
widget.variant:state selectors; more specific rules win, and at equal specificity the
later rule wins, with rules of the extended theme counted first.
Structs§
- Motion
- Timing values from the theme’s
[motion]table. - Resolved
- The result of resolving a theme.
- Selector
- Which widgets, variants and states a style rule applies to.
- Style
Props - Style properties after all matching rules have been layered.
- Theme
- A fully resolved theme, ready to style widgets.
- Theme
Registry - All themes known to an application: the built-in ones plus any loaded from disk.
Enums§
- Paint
- A resolved colour, possibly animated.
- Prop
Value - The value of one style property.
- State
- An interaction state a style rule can target.
Constants§
- REQUIRED_
COLORS - Colour tokens every resolved theme defines.
- SERIES_
COLORS - How many categorical series tones a theme carries:
series-1toseries-5. - WORD_
PROPS - Style keys whose value is a word from a fixed list, as
(widget, key, allowed words). Theme files are checked against this list; any other word is reported with its location.