Design system

Spacing

A 4px-based scale for padding, gaps and layout. Values come from colorography/tokens.css.

Spacing tokens live in src/ui/colorography/tokens.css. Use them for padding, margins and gaps.

How to choose

SpaceTypical use
4 to 8pxBetween an icon and its label, inside chips and pills
12pxBetween related controls in a row
16pxCard padding, gaps in a grid of cards
24pxBetween groups inside a page section
32 to 48pxBetween page sections
64 to 80pxAbove and below a page's hero area
.recommendation-card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-12);
  padding: var(--spacing-16);
}

In Tailwind, use the default spacing utilities (gap-3 is 12px, p-4 is 16px). They follow the same 4px steps.

Rules

  • Group related things by putting less space between them than between groups.
  • Inside a component, keep padding the same on all sides unless the content is a single line of text.
  • Avoid 6px and 10px for new layout. They exist for a few compact components.

On this page