Web Components
Platform binding for the Specs document format — draft.
Normative frame: SPECIFICATION.md §11.
Inherits from CSS
Emits Lit custom elements. Styling is delegated wholly to the CSS binding.
Every style key is bound exactly as the CSS binding states, unless overridden below. This binding never restates an inherited mapping: a second copy of a rule is a second thing to keep true.
Rules
The rules that resolve jointly on this platform’s own surfaces — props and anatomy are never inherited, so these are this binding’s own. Each rule’s ordered case table is its own page.
| Rule | Surface | Keys |
|---|---|---|
| layoutWalk | Anatomy | container, text, glyph, instance, slot |
| semanticsAndTags | Anatomy | text, container |
| slotsToProjection | Props | slot |
| statesToContract | Props | boolean, enum |
Style overrides
None. Every style key is inherited unchanged.
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 | a boolean member of the element’s contract, reflected as an attribute · rule statesToContract |
enum | bound | a named union type, reflected as an attribute the stylesheet selects on · rule statesToContract |
image | bound | a URL-valued property |
number | bound | a number member of the element’s contract |
object | bound | a named member interface; values as object literals |
slot | bound | a native <slot> projection point · rule slotsToProjection |
string | bound | a string member of the element’s contract, nullable-widened with null |
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 | a div in the shadow tree — or the tag its role decides · rule semanticsAndTags |
instance | bound | the composed custom element, configured |
rectangle | bound | a styled div |
slot | bound | a native <slot> — unnamed for the declared default slot, name="<kebab>" otherwise |
text | bound | a span in the shadow tree carrying the element’s content · rule semanticsAndTags |
ellipse | approximated | a fully-rounded div |
glyph | approximated | a mask-painted box via the shared glyph runtime |
line | approximated | a styled div |
vector | approximated | a styled div occupying the vector’s box |
polygon | unsupported | a styled div — box only, no shape |
star | unsupported | a styled div — box only, no shape |
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 |
|---|---|---|---|
binding | bound | property access on the element | Bindings resolve through the same shared pointer machinery React uses; the lit-side spelling lives in this emitter’s own props module. |
image | bound | a served asset URL | An $image pointer resolves from the registry entry’s own src under the emitted assets base; an entry without one is unresolved and nothing further is tried (ADR-063). |
literal | bound | through the CSS binding’s stylesheet | Style values are the CSS binding’s; the emitter never reads them. |
slotContent | bound | recursive lit-template composition from the registries | The composition walker mirrors React’s by declared intent — same contentStyles rule, same wording, the two targets move together. Instances of real custom elements where instanceOf names one; raw elements otherwise. |
subcomponent | bound | the sibling subcomponent’s emitted custom element | #/subcomponents/<key> resolves through the same instance-target resolution React uses. |
token | bound | nothing directly — styling is the CSS binding’s | As on React: the emitter never reads a $token. |
theme | approximated | a static data-theme-<group> attribute, in the template for an element inside the shadow tree and on the host for the root | The spelling comes from themeAttrs in @directededges/from-specs, the same helper React emits through and the stylesheet’s override blocks are generated from. The root is the host, so its selections are stamped in the component’s own lifecycle and only where the host does not already carry the attribute — which makes the authored theme a default a consumer can override; an element below the root is written into the template and keeps its selection regardless. Not realised: a selection a variant adds, changes, or withdraws with null. The attribute is written once from the default variant and does not vary with props, as on React (ADR-123). |
conditional | unsupported | — | As the CSS binding declares: the condition is discarded on the way to a stylesheet. |
elementType | unsupported | — | External type references are a consumer concern (ADR-012). |
mixed | unsupported | — | As the CSS binding declares: nothing is emitted for the sentinel. |
nested | unsupported | — | As on React: never read; deep configuration arrives through the slot-content graph. |
Platform surfaces
The platform-shaped questions this binding owes, none of which are CSS. propsToParameters, slotsToChildren and variantsToSelection graduated into concepts.props and concepts.propRules above; variant selection itself is the CSS binding’s propsToSelectors rule.
| Surface | Disposition |
|---|---|
styleAttachment | unverified |
Absent keys
Inherited. See Absent keys on the Overview.