Foundations · Spacing & density
Foundations

Spacing & density

Six surfaces share every colour, type and radius token. They differ only in rhythm — and that difference is itself tokenised. A component never knows which surface it is on.

Named spacings

These seven names are what components use. [data-density] re-points them. The bars below are the comfortable register, which is what these docs render in. The two panels under The three densities show the same names re-pointed by compact.

Token
Current value
--spacing-section-loose
--spacing-section
--spacing-section-tight
--spacing-block
--spacing-block-tight
--spacing-stack
--spacing-row

The three densities

ModeSurfacessectionblockrowCopy register
compactfeedback app, dense panels1.5rem0.75rem0.375remWords. "Retry", "Skip", "Done".
defaultapp, business dashboard2rem1rem0.5remLabels and fragments. One line of help.
comfortablewww, /business/3.5rem1.5rem0.625remFull sentences. Explain, then act.
.ss-widgetthird-party embeds1rem0.75rem0.375remAlmost none. The data is the content.
Compact
XX Marathon of San Francisco
15 Mar 2026 · 9 296 registrations
III Hyrox Challenge
02 Jun 2026 · 1 106 registrations
Same markup, same tokens. Only data-density differs — --spacing-block, --spacing-stack and --spacing-row re-point underneath it.
Comfortable
XX Marathon of San Francisco
15 Mar 2026 · 9 296 registrations
III Hyrox Challenge
02 Jun 2026 · 1 106 registrations
Same markup, same tokens. Only data-density differs — --spacing-block, --spacing-stack and --spacing-row re-point underneath it.

Density changes the space between things, never the type scale and never a hit target — the two panels above use identical font sizes and identical control heights.

Densities nest. A compact panel inside a comfortable page is legitimate and resolves correctly. A component that takes a density prop wins by setting the attribute on its own root.

<main data-density="comfortable">
  <section className="py-section">…</section>

  {/* a dense panel on a marketing page — legitimate */}
  <aside data-density="compact" className="p-block">…</aside>
</main>

Control heights & hit targets

32px
control-height-sm
desktop dashboards only
44px
control-height-md
the mobile floor
48px
control-height-lg
marketing CTAs

--spacing-touch is 44px and is the floor on anything a finger hits, in every density. WCAG asks 24px at AA and 44px at AAA; the feedback app is used on 4G after a race, by tired people, so the system takes the AAA number as its baseline.

Sporting Scouter Design System
Every token on this site is generated from theme.css.