System

Density

Task density, control heights, surfaces.

density.md

Meridian — density.md

Density, spacing & shell rhythm. Ranking: influences.md.
Primary absorb: Polaris task density + Fluent 4px / density multipliers + Cursor compact chrome + Linear content-over-chrome.
Typed source of truth: lib/design/shell.tsshellRhythm (mirrored in app/globals.css).

1. Laws

  1. Density follows the task — not a global aesthetic (Polaris).
  2. One component, many densitiesdata-surface remaps CSS vars; no forked Button.
  3. 4px grid — heights and pads on Fluent ramp (Layout).
  4. Indexes dense; detail breathes — space groups related fields.
  5. Touch floor 44px on mobile.
  6. Desktop chrome may go 28px — keyboard-first.
  7. No off-scale pixels — use h-control / h-row / shell-pad / shell-gap / type-*.

2. Control height scale

TokenpxUse
--control-h-xs24Desktop icon buttons
--control-h-sm28Compact chrome
--control-h32Application default (remapped per surface)
--control-h-md36Marketing secondary
--control-h-lg40Marketing primary CTA
--control-h-touch44Mobile targets
--row-hsurfaceIndex / list rows
--surface-pad / --surface-gapsurfaceShell interior rhythm

3. Surface remaps (shellRhythm)

Surfacecontrolrowpadgaptype ui
application3240201214
desktop283212813
marketing3644242016
mobile4452161216

Utilities: .h-control · .h-row · .shell-pad · .shell-gap · .shell-stack · .type-ui · .type-row · .type-meta · .type-label.

4. When to go denser / looser

DenserLooser
Tables, triage, file treesForms, onboarding, empty states
Command palette resultsMarketing stages
Agent event listsReading prose

5. Optical density tips (Linear)

  • Align icons and labels — perceived density drops when misaligned
  • Soften borders before removing information
  • Prefer selected wash over heavy separators

6. Agent checklist

  • Correct data-surface on the shell root
  • Heights via h-control / h-row / --control-h*
  • Type via type-ui / type-row / type-meta / type-label
  • Touch targets on mobile (44px floor)
  • No h-[NNpx] / off-scale text-[NNpx] / p-[NNpx]
  • npm run check:shell + check:design

7. Proof

Live matrix: /meridian/theme#shell-rhythmShellRhythmProof.

Sources

Raw