System

Spacing

Space is a scale of steps on a grid. Every padding, gap and margin takes one, so a page keeps its rhythm and a density context can tighten it in one place.

The scale

Plain spaces on an 8pt grid, 5 steps from 8px to 48px. Padding, gaps and margins take a step, never a number of their own.
  1. space-1 8px
  2. space-2 16px
  3. space-3 24px
  4. space-4 32px
  5. space-5 48px

In use

Larger steps hold larger things apart: the card's padding is space-3, its lines are space-2 apart, and the buttons sit space-1 from each other.

Dawn on the river

Twelve birds heard before the light came up.

OpenShare

Density

Density is a context like theme. Under data-density="compact" the same names give smaller values, so a dense table and a roomy form share one set of components.
comfortable and compact
comfortable (default)

Dawn on the river

Twelve birds heard before the light came up.

OpenShare
data-density="compact"

Dawn on the river

Twelve birds heard before the light came up.

OpenShare

Scales in the registry

A system takes its scale from the space registry. Plain uses 8pt-comfortable; the others trade density for room in different steps.
5 scales
4pt-compact4 8 12 16 24 32 48
8pt-comfortable8 16 24 32 48 64 96
8pt-standard4 8 12 16 24 32 48 64
golden4 6 10 16 26 42 68
tailwind-aligned4 8 12 16 24 32 40 48 64