CSS
Platform binding for the Specs document format — draft.
Normative frame: SPECIFICATION.md §11. This document states how
the CSS binding realises the schema; it does not restate what the members mean —
that is the reference at /schema.
Generated from mappings/bindings/css.json by scripts/build-mappings.mjs.
Edit the binding file, never this page.
Rules
The rules that resolve jointly — where no single key or kind determines any single output, the rule’s ordered case table IS the mapping, on its own page. Keys and kinds in the surface tables below link back here through their rule column.
| Rule | Surface | Keys |
|---|---|---|
| elementSelectors | Anatomy | text, glyph, vector, container, slot, instance, line, ellipse, rectangle |
| propsToSelectors | Props | boolean, enum, number, object |
| absolutePositioning | Styles | position, top, bottom, start, end, centerHorizontalOffset, centerVerticalOffset |
| autoLayout | Styles | layoutMode, mainAxisAlignment, crossAxisAlignment, wrap, wrapAlignment, itemSpacing |
| autoLayoutSizing | Styles | layoutSizingHorizontal, layoutSizingVertical |
| intrinsicSize | Styles | width, height, aspectRatio |
| strokeRendering | Styles | strokes, strokeAlign, strokeWeight |
| textTruncation | Styles | textOverflow, maxLines |
Styles
31 bound, 11 approximated, 6 unsupported, of 48 style keys.
A key whose row says rule does not map on its own — its rule is a case table on the rule’s own page. Writing a per-key mapping for it would be false, not merely incomplete.
| Disposition | Keys | Meaning |
|---|---|---|
bound | 31 | Realised, and confirmed against the implementation |
approximated | 11 | Realised with loss, and the loss is stated |
unsupported | 6 | Declared as not realised, with the resulting behaviour stated |
Every row below is a claim a reader may rely on.
Props
A prop is declared once in the spec and realised differently by kind on each platform. Unlike a style key, a kind may carry its own row and be governed by a rule — a kind is a population of props, and different populations of it resolve differently.
| Prop kind | Disposition | Realised by |
|---|---|---|
boolean | bound | Css, states · rule propsToSelectors |
enum | bound | Css, enumCase · rule propsToSelectors |
number | bound | Css · rule propsToSelectors |
object | bound | Css · rule propsToSelectors |
image | unsupported | — |
slot | unsupported | — |
string | unsupported | — |
Anatomy
An anatomy element’s names are the library’s; its TYPE is the contract’s, and the type is what each platform realises. A type may carry its own row and be governed by a rule — a type is a population of elements, and which type a node even becomes is itself a joint rule.
| Element type | Disposition | Realised by |
|---|---|---|
container | bound | Css · rule elementSelectors |
glyph | bound | Css · rule elementSelectors |
instance | bound | Css · rule elementSelectors |
rectangle | bound | Css · rule elementSelectors |
slot | bound | Css, contentStyles · rule elementSelectors |
text | bound | Css · rule elementSelectors |
ellipse | approximated | Css · rule elementSelectors |
line | approximated | Css · rule elementSelectors |
vector | approximated | Css · rule elementSelectors |
polygon | unsupported | — |
star | unsupported | — |
Values and References
What a platform does with each form a VALUE may take — the scalar forms (a
literal, the mixed sentinel) and the pointer grammar (SPECIFICATION §5.1’s six
reserved-marker forms plus the $nested paths; DSPEC-42 for the style-value half).
The set is closed: the safe key grammar admits no authored $-prefixed key, so no
document can mint a new marker. Notes stay inline — the forms’ reference pages are
hand-written and carry no generated binding section yet.
| Reference form | Disposition | Realised by | Notes |
|---|---|---|---|
image | bound | Css | An $image reaching a style value emits through backgroundImage as a custom property the emitting platform fills with the served URL. |
literal | bound | Css | The ordinary case; every style rule’s case table is written against literals. |
theme | bound | Cssvars | A token group’s non-default themes each emit an override block selected by [data-theme-<group>="<theme>"], re-declaring every custom property whose value differs in that mode — so the attribute the emitters write on a selecting element scopes the override to that element’s subtree rather than the document. The attribute spelling has to match themeAttrs in @directededges/from-specs exactly; the two copies agree by discipline, and a prefix changed on one side alone is a block that matches nothing. A subscribed collection emits no block, because its per-mode values are not in the workspace’s fetched data, and the run names those collections rather than skipping them silently (ADR-123). |
token | bound | tokens | Emitted per settings.spec.tokens: a dedicated token-value path recognises $token and renders it in the configured notation. |
binding | approximated | Css | A $binding never reaches a declaration. As selection it participates through the props surface; as a STYLE VALUE it is not applied — visible is the one possible exception and is not currently realised either, because the check is a literal false comparison a $binding object fails. Declared scope, not an unfound gap. |
conditional | unsupported | — | Not yet implemented: nothing in the transform matches a conditional, so a visible carrying the ADR-018 form renders permanently visible and the condition is discarded. The Figma render path does implement it, so a document survives a round trip and loses the condition only on the way to CSS. |
elementType | unsupported | — | External type references are a consumer concern (ADR-012); the stylesheet keys off element keys, never type URIs. |
mixed | unsupported | — | A mixed value states that the property varies across the text it was read from, so there is no single value to emit. Nothing is emitted, and this row says so rather than leaving a consumer to guess. Applies equally to React and Web Components, which delegate styling here. |
nested | unsupported | — | Deep configuration is structure, not styling; nothing to emit. |
slotContent | unsupported | — | Composition leaves no trace in a stylesheet: a fill’s own component styles itself, and the slot’s primitive formatting is the contentStyles surface, already declared under anatomy. |
subcomponent | unsupported | — | A subcomponent gets its own stylesheet; the reference itself emits nothing. |
Defaults
What an absent style key means is spec-level, not per-platform: two platforms that answer differently disagree about what the same document says. It is declared once in the schema — each style key’s page marks its own default — and the ambiguity absence carries is stated on the Overview.
What this platform does on absence is its own fact, and is recorded per key below.
A key whose behaviour is not declaredDefault disagrees with the contract — visibly,
and as a decision rather than an accident.
| Behaviour | Keys | Meaning |
|---|---|---|
platformInitial | 48 | Applies the platform’s own initial value, which may differ from the schema’s declared default. |
Seeded from the transform’s documented policy and not yet confirmed per key. A seeded value is a starting point, not a finding.
Losses
What this platform does is settled and stated above. Where a loss is real, its acceptability is a product question rather than a specification’s to settle alone. 6 of 48 keys raise one of 2 such questions, of which 2 remain open.
- A value is dropped rather than degraded. Affects
backgroundColor,effects. A gradient whose stops do not yield two resolvable colours is dropped whole. Apaddingside that is present but unresolvable is omitted while its siblings emit, whereascornerRadiussubstitutes0for the same failure. DSPEC-43 says a degradation applies the spec’s own recorded fallback, or applies nothing and warns — dropping part of a value silently is neither. Open. See #816 on the disagreement between the composite types, and #815 on the gradient path. - Zero is not distinguishable from unset. Affects
minWidth,minHeight,maxWidth,maxHeight. Both platforms currently treat a dimension of 0 as “no constraint” rather than “a constraint of zero”. Open. Deferred — see #814, and #812 on what an absentwidth/heightmeans. The two interact and should be settled together.