Skip to content

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.

RuleSurfaceKeys
layoutWalkAnatomycontainer, text, glyph, instance, slot
semanticsAndTagsAnatomytext, container
slotsToProjectionPropsslot
statesToContractPropsboolean, 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 kindDispositionRealised by
booleanbounda boolean member of the element’s contract, reflected as an attribute · rule statesToContract
enumbounda named union type, reflected as an attribute the stylesheet selects on · rule statesToContract
imagebounda URL-valued property
numberbounda number member of the element’s contract
objectbounda named member interface; values as object literals
slotbounda native <slot> projection point · rule slotsToProjection
stringbounda 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 typeDispositionRealised by
containerbounda div in the shadow tree — or the tag its role decides · rule semanticsAndTags
instanceboundthe composed custom element, configured
rectanglebounda styled div
slotbounda native <slot> — unnamed for the declared default slot, name="<kebab>" otherwise
textbounda span in the shadow tree carrying the element’s content · rule semanticsAndTags
ellipseapproximateda fully-rounded div
glyphapproximateda mask-painted box via the shared glyph runtime
lineapproximateda styled div
vectorapproximateda styled div occupying the vector’s box
polygonunsupporteda styled div — box only, no shape
starunsupporteda 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 formDispositionRealised byNotes
bindingboundproperty access on the elementBindings resolve through the same shared pointer machinery React uses; the lit-side spelling lives in this emitter’s own props module.
imagebounda served asset URLAn $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).
literalboundthrough the CSS binding’s stylesheetStyle values are the CSS binding’s; the emitter never reads them.
slotContentboundrecursive lit-template composition from the registriesThe 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.
subcomponentboundthe sibling subcomponent’s emitted custom element#/subcomponents/<key> resolves through the same instance-target resolution React uses.
tokenboundnothing directly — styling is the CSS binding’sAs on React: the emitter never reads a $token.
themeapproximateda static data-theme-<group> attribute, in the template for an element inside the shadow tree and on the host for the rootThe 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).
conditionalunsupported—As the CSS binding declares: the condition is discarded on the way to a stylesheet.
elementTypeunsupported—External type references are a consumer concern (ADR-012).
mixedunsupported—As the CSS binding declares: nothing is emitted for the sentinel.
nestedunsupported—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.

SurfaceDisposition
styleAttachmentunverified

Absent keys

Inherited. See Absent keys on the Overview.