Chapter 02 Foundations
Colour
Two brand colours, three neutrals, and product shades tuned until small text reaches 7:1.
Brand
The core palette, as is: fills, the logo and large text only.
| Token | Value | Tailwind | For | Sample |
|---|---|---|---|---|
--ui-brand-blue | #0059FF | bg-brand-blue | Logo and large fills. Primary in product UI. | |
--ui-brand-red | #DC4B4B | bg-brand-red | Logo and large fills. Danger in product UI. | |
--ui-ink | #0B1020 | bg-ink | Dark ground and text. | |
--ui-paper | #F6F7FB | bg-paper | Light ground. | |
--ui-slate | #586087 | bg-slate | Labels, secondary text, borders. |
Product tokens
Use these in product code, never a hex: dark mode follows.
| Token | Value | Tailwind | For | Sample |
|---|---|---|---|---|
--ui-bg | #f6f7fb · #0b1020 | bg-bg | The page. | |
--ui-surface | #ffffff · #151b30 | bg-surface | Cards, fields, floating layers. | |
--ui-text | #0b1020 · #f6f7fb | text-text | Body text. | |
--ui-text-muted | #454c6e · #c9cee3 | text-text-muted | Hints and secondary text, 7:1. | |
--ui-border | #586087 · #9fa5c0 | border-border | Field and control edges, 3:1. | |
--ui-divider | #e4e7f2 · #262d48 | border-divider | Lines between rows. Not an edge. | |
--ui-primary | #0047cc · #8fb4ff | bg-primary | The main action, links, selection. | |
--ui-on-primary | #ffffff · #0b1020 | text-on-primary | Text on primary. | |
--ui-secondary | #e4e7f2 · #232a45 | bg-secondary | Quiet buttons, tracks. | |
--ui-on-secondary | #0b1020 · #f6f7fb | text-on-secondary | Text on secondary. | |
--ui-highlight | #dbe6ff · #1d3a8a | bg-highlight | Selected row, info badge. | |
--ui-on-highlight | #0b1020 · #f6f7fb | text-on-highlight | Text on highlight. | |
--ui-focus | #0047cc · #8fb4ff | outline-focus | The keyboard ring. | |
--ui-danger | #9a1d1d · #f2a3a3 | bg-danger | Errors, destructive actions. | |
--ui-on-danger | #ffffff · #0b1020 | text-on-danger | Text on danger. | |
--ui-danger-soft | #fdeeee · #3a1418 | bg-danger-soft | Error alert and badge ground. | |
--ui-success | #14532d · #86efac | bg-success | Done, saved, paid. | |
--ui-on-success | #ffffff · #0b1020 | text-on-success | Text on success. | |
--ui-success-soft | #e3f5e9 · #0f2e1c | bg-success-soft | Success alert and badge ground. | |
--ui-warning | #7a3a0a · #fcd34d | bg-warning | Needs a look, not broken. | |
--ui-on-warning | #ffffff · #0b1020 | text-on-warning | Text on warning. | |
--ui-warning-soft | #fdf1dc · #33260a | bg-warning-soft | Warning alert and badge ground. | |
--ui-backdrop | rgb(11 16 32 / 0.6) | bg-backdrop | Behind a dialog, both themes. |
Contrast, measured live
Each pair measured in the theme on screen: 7:1 text, 3:1 edges.
Text on background
--ui-text on --ui-bg…:1 · fails 7:1Text on surface
--ui-text on --ui-surface…:1 · fails 7:1Muted text
--ui-text-muted on --ui-surface…:1 · fails 7:1Primary
--ui-on-primary on --ui-primary…:1 · fails 7:1Secondary
--ui-on-secondary on --ui-secondary…:1 · fails 7:1Highlight
--ui-on-highlight on --ui-highlight…:1 · fails 7:1Danger
--ui-on-danger on --ui-danger…:1 · fails 7:1Danger, soft
--ui-danger on --ui-danger-soft…:1 · fails 7:1Success
--ui-on-success on --ui-success…:1 · fails 7:1Success, soft
--ui-success on --ui-success-soft…:1 · fails 7:1Warning
--ui-on-warning on --ui-warning…:1 · fails 7:1Warning, soft
--ui-warning on --ui-warning-soft…:1 · fails 7:1Border on surface
--ui-border on --ui-surface…:1 · fails 3:1Focus ring on background
--ui-focus on --ui-bg…:1 · fails 3:1Try a primary colour
Re-brand with one token; the ratio says if small text still reads.
One token re-colours every action
White on hsl(219 100% 40%): …:1, fails 7:1.
:root {
--ui-primary: hsl(219 100% 40%);
--ui-on-primary: #ffffff;
}
/* bg-primary, text-primary and every kit component follow */Rules
- Brand blue and red: fills and large text only, never small text.
- Red means errors and destructive actions, nothing else.
- No hex in product code:
--ui-*tokens only.