padding
The space held between the element’s bounds and its contents.
Path
…elements.<element>.styles.padding
Elements Supported
Value
TokenReference
A design token, written as a $token path plus a $type, as in { $token: Color/On surface, $type: color }. The consuming platform resolves it to a value.
Sides
Per-side values using logical inline-axis directions (start/end). Used for padding and strokeWeight when sides differ.
top: 8end: 16bottom: 8start: 16number (default: 0)
null
Themes
A TokenReference written here resolves under the theme in force on this element — the one it selects in themes, or the nearest ancestor’s. The same token path yields a different value under a different theme.
Platform bindings
Figma
Disposition: bound · Realised by: node.paddingTop / paddingRight / paddingBottom / paddingLeft
A uniform value or token sets all four sides; a per-side object expands to Figma’s physical padding properties. Loss: start always becomes the left padding and end the right, with no writing-direction branch, so a right-to-left context renders mirrored. A side omitted from the object is left at its current value rather than reset.
CSS
Disposition: approximated · Realised by: padding
A uniform value emits padding; a null emits padding: 0. A per-side object emits a padding-block and padding-inline pair, deliberately avoiding the four-value shorthand so a logical side is never misread as a physical one — the direction-safe treatment Figma lacks. Defect: a side present but unresolvable is omitted with no fallback, while cornerRadius substitutes 0 for the same class of failure. Nothing should be dropped; the two disagree.
Decisions
- ADR-010 — Sides and Corners Composite Types
- 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 |
Source
| Format | File |
|---|---|
| JSON Schema | packages/schema/schema/styles.schema.json |
| TypeScript | packages/schema/types/Styles.ts |
| Specification | §4.1a, §11 |