Skip to main content
Substrate emits exactly one spacing token: --space-unit, the brand’s spatial unit in px (space.unit; every bundled demo brand uses 4). There is no --space-1--space-16 ladder. All spacing is computed at the use site from three independent scalars.

The composition

Every spatial value in generated component CSS has this shape — real output from the badge component:
A component authors a spatial multiplier (here 2, 0.5, 1.5 — fractions welcome); the engine composes it with:
  • --space-unit — the brand constant (space.unit, px).
  • --density — the user’s continuous density preference (densityFactor, 0.8 → 1.3), written by the runtime. This is the lever for scoped density overrides, not --space-unit.
  • --scale — a continuous size multiplier for scaled contexts.
Because density is a runtime variable, changing it re-lays-out the interface instantly — no rebuild.

Density presets

Brands name positions on the density continuum under presets.density. The names are brand-chosen (an open map). One brand might ship:
Another names its levels discovery / default / workspace — proof the set is convention, not enum. The brand bounds how far users can push density via flexibility.density (min/max).

Radius

Corner radius follows the same pattern: --radius: calc(var(--radius-base) * var(--density)), with --radius-base from shape.radius-base.

All continuous scalars

For reference, the full scalar set (generated from the ground-truth manifest):

Config: Spacing & Density

How to author space.unit and density presets in a brand config.