Style Schema¶
Note
The shell defines its own schema for style keys and design tokens. The names are the shell's, chosen once, and the same key means the same thing on every block, module and surface. This note is the accepted proposal (the maintainer accepted it on 2026-10-27, from "create our own YAML schema"); the names are the starting set and may change while the shell is built. It fills the gaps that Style, Theme and Stylesheet Files leaves open: the full property list, the theme token set, the stylesheet selectors and the shadow keys.
Principles¶
- One name per concept.
Corner_Radiusis the radius everywhere; a block never has its own spelling. - Capitalised keys. Every key is Capitalised, and a key of several words Capitalises each word and joins them with
_(Border_Width). Enum values are full upper case (CENTER,START,AUTO). The rule is in TDL Language > Names and the Registry; this note does not restate it. - Pixels, not CSS units. A number is logical pixels; the forms in Common Keys and Conventions > Value forms apply. No
px,em,remsuffixes. - Flat first, groups where they pay. The maintainer's Style example is flat (
Border_Width,Border_Color); keep that. Groups appear only for repeated structures (aShadowsblock ofShadowblocks, D4). - Tokens are referenced, never copied. A theme defines a value once; styles and stylesheets name it.
- The schema is generated from the blocks. Each block and module declares its properties (type, default, choices, doc), parts and states in Python (Building Blocks > Properties, parts and states); the shell builds the key lists, the validation errors and a JSON Schema that validates the parsed tree from those declarations, so the TDL reference (TDL Language; folder 41 TDL Reference) and the code cannot drift (JSON Schema and Editor Support, ADR-0011 JSON Schema for Shell Files). The declaration form is proposed; Tesserae's mechanism is a model, not a dependency.
Style Keys¶
Proposed set for v1. A key a block does not have is an error with the nearest names (Style, Theme and Stylesheet Files > Errors specific to these files).
| Group | Keys | Notes |
|---|---|---|
| Fill | Background, Foreground, Fill, Opacity |
Foreground is text and icon colour; Fill is a shape's interior (from the maintainer's Icon example) |
| Border | Border { Width, Color }, Border_Width, Border_Color, Corner_Radius |
Border is always a block; the boolean Border: true or Border: false does not exist. The flat Border_Width and Border_Color are the same two values written as plain keys. Width takes one number, four in the order left, top, right, bottom, or named sides. Corner_Radius takes one number, four from the top-left corner clockwise, or named corners. A border takes layout space: the content and the children sit inside it |
| Space | Padding, Margin, Spacing |
Padding and Margin are four-sided (left, top, right, bottom); Spacing is a number |
| Text | Font_Family, Font_Size, Font_Weight, Line_Height, Text_Align, Overflow |
Font_Family is an ordered fallback list (tre takes one string, so the binder joins the list with ,; decided 2026-11-04); Font_Size is the text size in pixels. Overflow is CLIP or ELLIPSIS on a Text; on a single-line TextField it also takes SCROLL, the default there (decided 2026-11-08, Block Reference > TextField) |
| Shadow | Elevation, Shadows, Shadow_Bleed |
See below |
| Motion | Transition, Duration, Easing |
A property list plus timing; token names allowed |
| State | A state key (Hovered, Pressed, Focused, Disabled) holding style values |
Overrides the base values while the state holds |
Padding is transparent space inside an element, between its children and its four sides, and exists on every element that has Children. Margin is transparent space outside the element, around the element itself. Spacing is the distance between a layout's children. Gap is not a style key: it is the distance from a surface to what it is attached to, a surface key (Surface Types, TDL Language > Sizes (Shell Schema)). A Bar has no Margin, a Panel positions itself with Offset, and a Frame's Margin adds to its total size; those rules belong to the surfaces and are not repeated here.
Layout keys (Direction, Align_Items, Justify, Width, Height, Flex_Grow) belong to the block's properties, not to style (Building Blocks); the split is open.
Shadow Keys¶
Decision behind them: shadows are drawn inside the surface with a transparent margin (ADR-0010 Surface Shadows).
| Key | Meaning |
|---|---|
Elevation |
A percentage: 0% is no shadow and 100% is a little above a reasonable amount, about 64 px of reach in the maintainer's tests (D88). The theme turns the percentage into shadow layers. The 64 px comes from tests on a different renderer, so the curve and the numbers are provisional until tre's shadow rendering is seen (D90) |
Shadows |
A block of repeated Shadow blocks that replaces the elevation, ordered by position: each Shadow has Color, X, Y, Blur, Spread (no unnamed block as a list item, D4, ADR-0014 Shell File Language > Decisions on the Open Items (2026-10-30)) |
Shadow_Bleed |
The transparent margin around a surface body. AUTO (default) computes it from the shadow; a number or four-sided value overrides it |
Panel {
Elevation: 20%
Corner_Radius: 12
Shadows {
Shadow { Color: "#00000040", X: 0, Y: 2, Blur: 6, Spread: 0 }
Shadow { Color: "#00000020", X: 0, Y: 8, Blur: 16, Spread: 0 }
}
}
An Elevation and a Shadows block on one entry: Shadows wins and a warning names both. Shadow_Bleed applies to surfaces only; on a block it is an error, because only a surface owns a buffer. The names follow tre's four numbers per shadow (offset, blur, spread) without copying its tuple form (Value Types and Conversion).
Theme Tokens¶
A theme file holds token groups, each a Capitalised key (Color, Type, Shape, Space, Elevation, Motion). Proposed groups and starting names, small on purpose; the design system fills the values (50 Design System).
| Group | Names (proposed) | Holds |
|---|---|---|
Color |
Surface, Surface_Raised, On_Surface, On_Surface_Muted, Primary, On_Primary, Accent, Error, Warning, Success, Outline, Scrim |
Colour roles, not raw colours: a role says what it is for |
Type |
Caption, Label, Body, Title, Display; each with Font_Size, Font_Weight, Line_Height and optional Font_Family |
The type scale |
Shape |
None, Small, Medium, Large, Full |
Corner radii in pixels |
Space |
Step_1 to Step_8 |
A spacing scale in pixels |
Elevation |
Max |
The shadow list at 100%; the shell scales X, Y, Blur and Spread by the percentage (proposed) |
Motion |
Duration.Short, Duration.Medium, Duration.Long, Easing.Standard, Easing.Emphasized |
Milliseconds and easing names; zero under reduced motion |
A token is referenced as $group.name, for example $color.surface or $type.body.font_size; the reference is lowercase and the style engine matches it to the theme's Capitalised keys (On_Surface) without regard to case (D16, ADR-0014 Shell File Language > Decisions on the Open Items (2026-10-30)). The $group.name text is a plain string to TDL, resolved by the style engine by theme key; it is not a TDL variable and does not clash with TEL's delimiter. An unknown token is an error with the nearest names.
---
TDL: 0.2
Name: Dark
---
Theme {
Color {
Surface: "#1D1B20"
On_Surface: "#E6E0E9"
Primary: "#D0BCFF"
}
Shape {
Small: 4
Medium: 8
Large: 16
}
Elevation {
Max {
Shadows {
Shadow { Color: "#00000040", X: 0, Y: 16, Blur: 48, Spread: 0 }
}
}
}
}
A token name in a theme file (On_Surface) is a Capitalised key; the lowercase reference matches it ignoring case (D16). A theme file has a root block Theme { }, and Name: in its metadata block is required, as in every file (D39, TDL Language > The Metadata Block); unknown metadata is kept (D19). Scales use names, not numeric keys: Step_1 to Step_8 (D4). Elevation is a percentage (D88), so it has no named levels.
Light, dark, high contrast and reduced motion are modes of one theme: a Modes block (Light, Dark, High_Contrast, Reduced_Motion) overrides token values, and the shell picks the mode from the desktop (Goals and Non-Goals G7). Recommendation over one theme file per mode: tokens stay in one place and a missing override is easy to spot. Open.
Decided from the M3a Build (2026-11-05)¶
The maintainer accepted these as recommended; the questions and the build are in M3 Build Log (D33 to D39, D41).
| # | Rule |
|---|---|
| D33 | The shipped Default theme is a dark theme with steel blue as its primary colour. The base block is the dark look, and also what a desktop with no colour-scheme preference gets; Light overrides the colours; High_Contrast is black and white. The code session proposes the exact values, in shipped/Themes/Default_Theme.tdl, and the maintainer adjusts them. The values are plain data and the design system takes them over |
| D34 | Accent: DESKTOP is how a theme asks for the desktop's accent colour (Portals); with no desktop accent it is the theme's Primary |
| D35 | Reach is dropped from Elevation. The margin comes from each shadow's own numbers, which is exact (the table above no longer lists it) |
| D36 | Amended 2026-11-21 by ADR-0022 Default Stylesheet: an absent Appearance.Stylesheets key means [Default], so the shipped Default stylesheet applies; an explicit Stylesheets: [] means none and a block then keeps its own look, and check gives a Note when a TextField or List is used (appearance-no-stylesheet, proposed). Before: it applied only when named. The Default theme is always the token source |
| D38 | A theme has tokens only, no style values. Priority stays theme (the token values), then stylesheet, then style, then inline; a stylesheet is the lowest layer of style values |
| D39 | :hovered, :pressed, :focused, :disabled and ::part selectors are read and skipped with a warning in M3a; they are built with the events in M3b |
| D41 | A token is allowed on any key of a block, in an inline Style and in a Bar's Style, but not on a Bar's placement keys (Edge, Width, Height, Gap and the like) |
Stylesheet Selectors¶
A stylesheet is a root block Stylesheet { } holding Rule blocks, repeated as needed and ordered by position. Each Rule has a Selector: property, a quoted string, and style values beside it (D5, ADR-0014 Shell File Language > Decisions on the Open Items (2026-10-30)).
| Selector | Matches | Example Selector: value |
|---|---|---|
| A block or module name | Every use of it | "Text" |
| A leading dot | A class set with Class: |
".warning" |
| A leading hash | One unique Name: |
"#clock_label" |
| A trailing state | The state | "Button:hovered" |
| A trailing double colon | A named part of a block | "Slider::track" |
A module name ("Clock") matches every use of that module and applies its values to the module's root block only (maintainer, 2026-11-05, D40). Inheriting values such as Foreground and Font_Size reach the children through tre. The module's inner blocks are styled by type, class or #name; there is no descendant selector in v1.
The selector is a string, so ., #, : and :: are not TDL syntax there. Specificity is the order in the table, reversed: name beats class beats type; a state adds to the base rule. Within the priority order theme, stylesheet, style, inline (Style, Theme and Stylesheet Files > Rules).
---
TDL: 0.2
Name: Base_Stylesheet
---
Stylesheet {
Rule {
Selector: "Text"
Foreground: $color.on_surface
Font_Size: $type.body.font_size
}
Rule {
Selector: ".warning"
Foreground: $color.warning
}
Rule {
Selector: "Button:hovered"
Background: $color.surface_raised
}
}
Parts and Module Rules (Decided 2026-11-13)¶
- A part is declared with
Part: nameon a block in a module's layout (Block Reference > State). The selector forms areModule::partandModule::part:hovered,:pressedor:disabled..class::partand#name::partare left out of v1 and give a load warning "not built" (maintainer, 2026-11-13, as recommended). A part rule weighs between a class rule and a#namerule. - A part also shows the module's
:disabledstate when the module's root is disabled. - Rule keys written for a module name pass down the chain of first children from the module's root, so a rule such as
Clock { Background: ... }reaches the visible block when the root is a wrapper; this replaces the wording "roots only" of D40 (maintainer, 2026-11-13, as recommended). The order stays module above type.
Why Not Copy CSS or Another Framework's Names¶
- A CSS-shaped schema invites properties the shell does not support and raises the expectation that CSS behaviour (cascade by specificity across the tree, inheritance) carries over. The shell has one priority rule and opt-in inheritance (ADR-0007 Shell UI Layer > Blocks, modules and styling (2026-10-26)).
- The shell is independent of Tesserae UI (ADR-0006 Shell Independent of Tesserae UI); sharing its key names would imply a compatibility the shell does not promise. #needs-verification against the Tesserae theme reference before any name is declared the same or different on purpose.
Open¶
The maintainer accepted the proposal as written on 2026-10-27; the names below are the starting set and may change while the shell is built and tested.
- The principles and the key set.
- The colour role names.
- Modes inside one theme.
- The
$group.namereference form. - The state, part and selector forms.
- Which keys are style and which are block layout properties: as proposed, with the split revisited when the blocks are specified.
-
Elevationas a level number. Superseded 2026-11-02: it is a percentage (D88). Open: the curve from the percentage to the shadow, and the values ofMax(the design system). - The JSON Schema generation from block declarations: JSON Schema and Editor Support, ADR-0011 JSON Schema for Shell Files.
- TDL forms for selectors (
Ruleblocks, D5), number keys (named levels and steps, D4) and unnamed list blocks (repeated named blocks, D4), ADR-0014 Shell File Language > Decisions on the Open Items (2026-10-30). - The case of token references against Capitalised token keys: matched ignoring case (D16).
Acceptance Criteria¶
- Every style key in the shell notes appears in this schema once, with one meaning.
- A theme with every token group loads; an unknown token reports
file:line:columnand the nearest names. - A stylesheet with each selector form loads and applies in the stated priority.
- A surface with an elevation draws its shadow inside a margin sized by
Shadow_Bleed: auto, and the reserved space is unchanged. - The generated JSON Schema rejects an unknown key when the shell validates the parsed tree at load (editor feedback is open: JSON Schema and Editor Support).