Documentation
Foundations
Colour
Five OKLCH palettes with fixed lightness per step, and semantic colours on top of them. Pick any brand hue: every text, border and focus pair still passes WCAG.
How it works
Every palette has 16 steps, named after their lightness in OKLCH: step 54 is 54 % light in every palette. Only hue and chroma change between palettes, so two steps always have the same contrast, whatever the hue. That is why your brand colour can be anything: the steps it lands on were already checked.
On every build, 226 colour pairs are checked twice: with the current palettes, and across every hue in 5° steps. All 226 pass.
Palettes
The swatches below use the live CSS variables, so they show this site's theme: the accent is the dsgn orange. Use palette steps to build a theme, not in components: components use the semantic colours further down.
Neutral
- 14
- 18
- 22
- 26
- 30
- 38
- 46
- 54
- 64
- 70
- 76
- 85
- 90
- 94
- 97
- 99
Accent
- 14
- 18
- 22
- 26
- 30
- 38
- 46
- 54
- 64
- 70
- 76
- 85
- 90
- 94
- 97
- 99
Danger
- 14
- 18
- 22
- 26
- 30
- 38
- 46
- 54
- 64
- 70
- 76
- 85
- 90
- 94
- 97
- 99
Success
- 14
- 18
- 22
- 26
- 30
- 38
- 46
- 54
- 64
- 70
- 76
- 85
- 90
- 94
- 97
- 99
Warning
- 14
- 18
- 22
- 26
- 30
- 38
- 46
- 54
- 64
- 70
- 76
- 85
- 90
- 94
- 97
- 99
In CSS each step is --dsgn-<palette>-<step>, for example --dsgn-accent-54.
Semantic colours
Components use 59 semantic colours named by their job: --dsgn-text, --dsgn-surface-raised, --dsgn-accent-solid. Each points at a palette step in light mode and another in dark mode, so the same CSS works in both. Use these in your own CSS too; npx dsgn lint warns about hard-coded colours.
Surfaces
| Swatch | Token | Light | Dark |
|---|---|---|---|
--dsgn-surface-sunken | neutral 94 | neutral 14 | |
--dsgn-surface-base | neutral 97 | neutral 18 | |
--dsgn-surface-raised | neutral 99 | neutral 22 |
Text
| Swatch | Token | Light | Dark |
|---|---|---|---|
--dsgn-text | neutral 22 | neutral 97 | |
--dsgn-text-muted | neutral 46 | neutral 70 | |
--dsgn-text-disabled | neutral 70 | neutral 46 |
Borders and focus
| Swatch | Token | Light | Dark |
|---|---|---|---|
--dsgn-border | neutral 85 | neutral 30 | |
--dsgn-border-strong | neutral 54 | neutral 54 | |
--dsgn-border-control | neutral 64 | neutral 54 | |
--dsgn-focus | accent 54 | accent 70 | |
--dsgn-focus-danger | danger 54 | danger 70 |
Controls
| Swatch | Token | Light | Dark |
|---|---|---|---|
--dsgn-control-track | neutral 94 | neutral 14 | |
--dsgn-control-track-border | neutral 94 | neutral 46 | |
--dsgn-control-selected | neutral 99 | neutral 38 | |
--dsgn-control-solid | accent 54 | accent 64 | |
--dsgn-control-solid-hover | accent 46 | accent 70 | |
--dsgn-control-solid-pressed | accent 38 | accent 76 | |
--dsgn-control-solid-text | neutral 99 | neutral 14 | |
--dsgn-control-subtle | accent 94 | accent 26 | |
--dsgn-control-subtle-hover | accent 90 | accent 30 | |
--dsgn-control-subtle-pressed | accent 85 | accent 38 | |
--dsgn-control-text | accent 38 | accent 85 |
Neutral
| Swatch | Token | Light | Dark |
|---|---|---|---|
--dsgn-neutral-solid | neutral 22 | neutral 90 | |
--dsgn-neutral-solid-hover | neutral 30 | neutral 85 | |
--dsgn-neutral-solid-pressed | neutral 38 | neutral 76 | |
--dsgn-neutral-subtle | neutral 94 | neutral 26 | |
--dsgn-neutral-subtle-hover | neutral 90 | neutral 30 | |
--dsgn-neutral-subtle-pressed | neutral 85 | neutral 38 | |
--dsgn-neutral-text | neutral 38 | neutral 85 | |
--dsgn-neutral-border | neutral 76 | neutral 38 | |
--dsgn-neutral-solid-text | neutral 99 | neutral 14 |
Accent
| Swatch | Token | Light | Dark |
|---|---|---|---|
--dsgn-accent-solid | accent 54 | accent 64 | |
--dsgn-accent-solid-hover | accent 46 | accent 70 | |
--dsgn-accent-solid-pressed | accent 38 | accent 76 | |
--dsgn-accent-subtle | accent 94 | accent 26 | |
--dsgn-accent-subtle-hover | accent 90 | accent 30 | |
--dsgn-accent-subtle-pressed | accent 85 | accent 38 | |
--dsgn-accent-text | accent 38 | accent 85 | |
--dsgn-accent-border | accent 76 | accent 38 | |
--dsgn-accent-solid-text | neutral 99 | neutral 14 |
Status
| Swatch | Token | Light | Dark |
|---|---|---|---|
--dsgn-danger-solid | danger 54 | danger 64 | |
--dsgn-danger-solid-hover | danger 46 | danger 70 | |
--dsgn-danger-solid-pressed | danger 38 | danger 76 | |
--dsgn-danger-subtle | danger 94 | danger 26 | |
--dsgn-danger-subtle-hover | danger 90 | danger 30 | |
--dsgn-danger-subtle-pressed | danger 85 | danger 38 | |
--dsgn-danger-text | danger 38 | danger 85 | |
--dsgn-danger-border | danger 76 | danger 38 | |
--dsgn-danger-solid-text | neutral 99 | neutral 14 | |
--dsgn-success-solid | success 54 | success 64 | |
--dsgn-success-subtle | success 94 | success 26 | |
--dsgn-success-text | success 38 | success 85 | |
--dsgn-success-border | success 76 | success 38 | |
--dsgn-success-solid-text | neutral 99 | neutral 14 | |
--dsgn-warning-solid | warning 54 | warning 64 | |
--dsgn-warning-subtle | warning 94 | warning 26 | |
--dsgn-warning-text | warning 38 | warning 85 | |
--dsgn-warning-border | warning 76 | warning 38 | |
--dsgn-warning-solid-text | neutral 99 | neutral 14 |
Your brand colour
A project theme moves the accent palette to your hue and, if you like, tints the greys with it. Lightness per step stays fixed, so the contrast guarantee holds. Chroma is capped to what the guarantee covers: 0.30 for colours, 0.04 for greys. Try it in the theme customizer, or see Make it yours.