Foundations
Tokens
Every value in Sorted UI comes from one file, src/tokens/tokens.css: plain CSS custom properties. This page reads that file when the site builds, so it always shows the current values. Type tokens are on the Typography page.
Brand / accent
8 tokensNeutral ramp: ink
7 tokensNeutral ramp: hair
6 tokensSurfaces
4 tokensConstant dark-blue surfaces
14 tokensElevation
4 tokensOpacity scale
7 tokensSpacing
11 tokens| Token | Value | Scale | Use |
|---|---|---|---|
--space-2 | 2px | segmented-meter gaps only | |
--space-4 | 4px | icon gaps, tight inline | |
--space-8 | 8px | chip padding, small gaps | |
--space-12 | 12px | control inner padding (y) | |
--space-16 | 16px | control inner padding (x), label gaps | |
--space-20 | 20px | cell padding (compact) | |
--space-24 | 24px | cell padding (default), gutters | |
--space-32 | 32px | section internal, button x-padding (lg) | |
--space-40 | 40px | hero side padding (desktop) | |
--space-56 | 56px | hero vertical padding | |
--space-80 | 80px | major section vertical rhythm |
Radius
2 tokens--r: 3px--radius-none: 0Borders
2 tokens| Token | Value | Use |
|---|---|---|
--border-hairline | 1px solid var(--hair) | |
--border-hairline-2 | 1px solid var(--hair-3) |
Motion
1 tokens| Token | Value | Use |
|---|---|---|
--motion | 150ms ease |
Using tokens
Read tokens with var(). Never copy the value into a component.
.card {
background: var(--paper);
border: 1px solid var(--hair-2);
border-radius: var(--r);
padding: var(--space-24);
color: var(--ink-1);
}
.card:hover { box-shadow: inset 3px 0 0 var(--blue); transition: box-shadow var(--motion); }Do
- Use
--bluefor links, primary actions and the one highlight on a surface. - Use the ink ramp for text and the hair ramp for borders and grid lines.
- Use the spacing tokens; the scale is strict 4px.
Don't
- Use
--livefor anything but the LIVE status dot. - Round a corner past
--r(3px). - Theme the constant dark-blue surfaces (nav, footer, drawer).