Type & space scales
How typeScale and spaceScale compile to clamp()-based fluid modular scales, and which utilities consume the resulting tokens.
On this page
Both scales share one model (authored in design-system.json as typeScale /
spaceScale — see authoring.md): a fluid modular scale.
The model
-
baseanchors the value atbaseStep; every other step is a power of theratioaway (step n = base × ratio^(n − baseStep)). -
With
fluid, each step compiles to aclamp(): the scale usesfluid.minRatioat/belowfluid.minVwand grows toratioatfluid.maxVw, interpolating between — so large steps spread apart on wide viewports and compress on phones, with no breakpoint jumps.baselinenames the pivot step that stays closest tobase. -
namesbecome the token suffixes. -
Type: base
1remat stepm, ratio 1.2 (1.12 below 22.5rem); steps2xs,xs,s,m,l,xl,2xl,3xl,4xl,5xl,6xl,7xl. -
Space: base
1remat stepm, ratio 1.25 (1.2 below 22.5rem); steps2xs,xs,s,m,l,xl,2xl,3xl,4xl,5xl,6xl,7xl.
What consumes them
- Type:
--text-<name>tokens → typography role sizes (font-<role>classes, heading defaults) and text-size utilities. - Space:
--space-<name>tokens → gap (g), spacing utilities, andrhythm(relationship-based vertical margins between headings, paragraphs, lists, media). Preferrhythmfor vertical flow over per-element margins. - In the
tailwindformat these stay in their own namespaces (--text-*via@theme,--space-*as plain vars) — see formats.md for why--spacing-*is deliberately not used.