wrapperCollapse
disposition: bound, direction: figma-to-spec, basis: implementation
An anatomy rule of the Figma binding. The element types named below resolve jointly here — which type a node becomes, or what tag and semantics an element takes, is decided by this rule rather than per type.
Keys. container, text, glyph
Operands
Every fact the rule reads. Nothing outside this set participates.
| Operand | From |
|---|---|
settings.spec.collapsePrimitiveWrapper | declared settings |
root.children | the root container’s anatomy-visible children, per variant |
root.styles | the root’s non-default style keys, after default removal |
Derived predicates
| Name | Expression | Source |
|---|---|---|
derived.semanticFrame | root.styles = carries any disqualifying key — clipsContent, cornerRadius, strokes, strokeAlign, strokeWeight, itemSpacing, padding, effects, backgroundColor, cornerSmoothing | capture-side collapse eligibility — a non-default value on one of these means the container is a semantic frame, not a Figma wrapper |
Cases
Ordered — first match wins.
| # | When | Emits | Why |
|---|---|---|---|
| 1 | settings.spec.collapsePrimitiveWrapper = true and root.children = exactly one, in every variant and derived.semanticFrame = false | one anatomy element where Figma has two layers — keyed by the wrapper, typed by the leafpositioning and base keys conveyed from the wrapper always; size keys conveyed only where the leaf lacks its ownthe pre-collapse layer name in $extensions['com.figma'].name; a role the collapsed child carried in childRole | ADR-058: the wrapper existed for Figma’s sake, so the spec records the one element the design means — provenance keeps the round trip honest (ADR-083’s collapse family) |
Otherwise
no collapse — both layers stay elements — All-or-nothing across variants: one ineligible variant means no variant collapses, or the same element would exist in some variants and not others
A cross-concern rule: it rewrites anatomy, element styles and binding refs together.