mainAxisAlignment
Where children sit along the axis their parent stacks them on.
Path
…elements.<element>.styles.mainAxisAlignment
Elements Supported
Value
"START"(default) — Children gather at the leading edge of the stacking axis."END"— Children gather at the trailing edge of the stacking axis."CENTER"— Children gather at the midpoint of the stacking axis."SPACE_BETWEEN"— Remaining space is distributed between children, pinning the first and last to the edges.null— The element has no auto-layout, so there is no stacking axis to align along.
Platform bindings
Figma
Disposition: bound · Realised by: rule wrapping
Remaps all four schema values to Figma’s primary-axis vocabulary. Gated on the node actually having the property, which effectively means an auto-layout container.
CSS
Disposition: bound · Realised by: rule autoLayout
Resolved jointly with
This key does not map on its own. Its rule’s ordered case table is linked above.
wrapping — Figma
autoLayout — CSS
Figma key
Reads from primaryAxisAlignItems. See ADR 040 — Layout Alignment.
Decisions
- ADR-040 — Replace
primaryAxisAlignItemsandcounterAxisAlignItemswithmainAxisAlignmentandcrossAxisAlignment - ADR-090 — Container Promotion Sources Opened to Closed-Value Layout Properties
- ADR-113 — Style defaults belong to the schema
Rules
| Rule | Statement |
|---|---|
| DSPEC-44 | Every property of Styles declares a default, and its value validates against that property’s own schema |
| DSPEC-45 | A declared default is a literal, never a TokenReference, PropBinding or Conditional |
| DSPEC-47 | Jointly resolved keys are stated as an ordered case table over a declared operand set, not as prose |
Source
| Format | File |
|---|---|
| JSON Schema | packages/schema/schema/styles.schema.json |
| TypeScript | packages/schema/types/Styles.ts |
| Specification | §4.1a, §11 |