Spacing & Layout — Options
The 4/8px rhythm and where widths cap. Audit found spacing already healthy — the open question is how it's codified.
The scale (Tailwind steps, 4px base)
4pxicon-label gap, tight inline
8pxchips, small gaps (gap-2)
12pxdefault control gap (gap-3)
16pxcard padding unit, group gap
24pxbetween groups (space-y-6)
32pxsection padding
48pxbetween page sections
Option A — Codify scale + width table ✓ CHOSEN
Tailwind steps only + documented rules for gaps and max-widths.
- • Audit shows 0 violations — spacing already follows the scale
- • Only real gap: 10 max-w values with no usage rule → write the table
- • Zero code churn
Option B — Semantic spacing tokens
space-xs/sm/md/lg/xl token layer over the scale.
- • Shared vocabulary with designers
- • Relabels values that already work; every gap becomes a lookup
- • Value appears with multi-brand/theming needs we don't have
Option C — Strict 8px grid
Ban the 4px sub-grid (gap-1, gap-1.5, gap-3).
- • Simpler rule on paper
- • Research keeps 4px for tight internal spacing — we use it correctly (gap-1.5 chips, gap-3 controls)
- • Would force worse micro-layout
Show audit of the app before this rule
Audit — what we have today
- ✓ Clean 4/8 rhythm: gap-3 (115), gap-2 (105), space-y-2 (100), space-y-4 (54), gap-4 (45), space-y-6 (32)
- ✓ 0 arbitrary spacing values (grep hits were shadcn internals)
- ✓ PageShell standardizes app-page structure
- ✗ 10 different max-w-* values, no rule for which content gets which cap
- ✗ “Related = tighter than unrelated” never written down
Shared rules (all options)
- • Internal spacing ≤ external spacing (a group is tighter inside than around)
- • Label↔input 4–8px; group↔group 24px+; section↔section 48px+
- • Width table: app content max-w-7xl · long-form prose max-w-prose · dialogs max-w-md/lg · marketing hero max-w-5xl
- • No arbitrary spacing values
Show research sources
Decision: Option A
- 1. Nothing to fix. The audit found zero violations — a clean 4/8 rhythm with every scale step used in the right place. Codify, don't churn.
- 2. B rejected: semantic tokens relabel working values; their payoff (multi-brand theming) is a problem we don't have.
- 3. C rejected: research keeps the 4px sub-grid for tight internal spacing — we use it correctly (chips, icon gaps).
- Applied at adoption: scale table + internal≤external rule + max-width table written into spacing-system.md. No code changes needed.