Home / Foundations / Colour & tokens
Colour & tokens
The palette, its contrast record, the ink layer, and the literals a re-theme must catch.
Two themes, one token file. tokens.json now carries a dark value for every colour primitive (and the data-viz series); tokens.css emits a prefers-color-scheme: dark block plus [data-theme=dark] override, and the core stylesheets consume semantic aliases only — so the whole system flips without a second stylesheet. Dark mode raises surfaces (luminance hierarchy) instead of relying on shadows. Toggle the theme in the topbar to see it live.
Surfaces · live var() values
swatches render the live custom property, not a copyText · live var() values
swatches render the live custom property, not a copyAccent & status · live var() values
swatches render the live custom property, not a copyTints · live var() values
swatches render the live custom property, not a copyTint borders · live var() values
swatches render the live custom property, not a copySolid surfaces · live var() values
swatches render the live custom property, not a copyInk panels · live var() values
swatches render the live custom property, not a copyLogs · live var() values
swatches render the live custom property, not a copyFocus & data-viz · live var() values
swatches render the live custom property, not a copyData visualisation · live var() values
swatches render the live custom property, not a copyContrast audit WCAG 2.2: 4.5:1 normal text · 3:1 large text / non-text
1/28 pairs below threshold| Pair | Foreground | Background | Measured | Required | |
|---|---|---|---|---|---|
| Body text --text-primary on --surface-page | #000000 | #fafafa | 20.12:1 | 4.5:1 | pass |
| Body text --text-primary on --surface-card | #000000 | #ffffff | 21.00:1 | 4.5:1 | pass |
| Secondary --text-secondary on --surface-page | #666666 | #fafafa | 5.50:1 | 4.5:1 | pass |
| Secondary --text-secondary on --surface-card | #666666 | #ffffff | 5.74:1 | 4.5:1 | pass |
| Placeholder --text-placeholder on card | #767676 | #ffffff | 4.54:1 | 4.5:1 | pass |
| Accent --interactive on --surface-page | #0057d9 | #fafafa | 5.98:1 | 4.5:1 | pass |
| Accent --interactive on --surface-card | #0057d9 | #ffffff | 6.24:1 | 4.5:1 | pass |
| Focus outline --interactive on card | #0057d9 | #ffffff | 6.24:1 | 3.0:1 | pass |
| Control boundary --border-control on card | #8f8f8f | #ffffff | 3.23:1 | 3.0:1 | pass |
| Decorative border --border-default on card | #e5e5e5 | #ffffff | 1.26:1 | 3.0:1 | fail |
| OK --status-success on card | #04713f | #ffffff | 6.11:1 | 4.5:1 | pass |
| OK --status-success on tint | #04713f | #dcfce7 | 5.56:1 | 4.5:1 | pass |
| WARN --status-warning on card | #9a4f07 | #ffffff | 6.01:1 | 4.5:1 | pass |
| WARN --status-warning on tint | #9a4f07 | #fef3c7 | 5.40:1 | 4.5:1 | pass |
| ERR --status-danger on card | #c81e2c | #ffffff | 5.71:1 | 4.5:1 | pass |
| ERR --status-danger on tint | #c81e2c | #fee2e2 | 4.67:1 | 4.5:1 | pass |
| Accent text --interactive on tint | #0057d9 | #dbeafe | 5.11:1 | 4.5:1 | pass |
| Solid accent with white text | #ffffff | #0052f0 | 6.06:1 | 4.5:1 | pass |
| Solid success with white text | #ffffff | #008348 | 4.84:1 | 4.5:1 | pass |
| Solid warning with white text | #ffffff | #b45309 | 5.02:1 | 4.5:1 | pass |
| Solid danger with white text | #ffffff | #e00b1c | 4.96:1 | 4.5:1 | pass |
| Text on ink --text-on-ink on --ink-panel | #ffffff | #000000 | 21.00:1 | 4.5:1 | pass |
| Banner text on paper surface | #000000 | #f7f7f7 | 19.60:1 | 4.5:1 | pass |
| Highlight text on ink chip | #c9c9c9 | #27272a | 8.99:1 | 4.5:1 | pass |
| Ink secondary --ink-secondary on --ink-panel | #a3a3a3 | #000000 | 8.33:1 | 4.5:1 | pass |
| Log success on --code-bg | #4ade80 | #0a0a0a | 11.36:1 | 4.5:1 | pass |
| Log warning on --code-bg | #fbbf24 | #0a0a0a | 11.86:1 | 4.5:1 | pass |
| Log danger on --code-bg | #f87171 | #0a0a0a | 7.16:1 | 4.5:1 | pass |
Contrast status after 0.2. All text pairs pass: the accent darkened to #0068e0 (4.96:1 on --bg), warning text to #a85708 (4.93:1 on its tint), nav labels now use --text-secondary (#666, 5.74:1) and placeholders use --placeholder (#767676, 4.54:1). Control boundaries use --border-control (3.23:1, meets the 3:1 non-text rule); the decorative --line border remains 1.26:1 by design. The translucent --focus ring is always accompanied by the solid accent outline, so the focus indicator meets 3:1. These pairs are now enforced in CI by lint rule TDS011.
Historical hard-coded colours (pack era — all resolved in core 0.2)
a full re-theme must address these — references/design-tokens.md says the same| Value | Where | Note |
|---|---|---|
| #000000 | .btn.primary, .bulkbar border, .brand-mark, .nav-item:hover, .avatar.you, .bubble.user, .basic pins | Ink emphasis — intentional, but repeated as a literal |
| #ffffff | cards, buttons, inputs, bubbles, .btn.primary text | Base white |
| #333333 | .btn.primary:hover | Ink hover |
| #0a0a0a | .bulkbar, .logpanel, .toast2, pre.log | Terminal black (--codebg token duplicates it) |
| #3f3f46 | .nav-item, .chip text, .kbd text, .action-tag | Zinc-700 text |
| #444444 | .think pre | Reasoning text |
| #999999 | .nav-label, .composer placeholder | Muted micro-text (low contrast, see /audit) |
| #9d9d9d | input::placeholder, textarea::placeholder | Placeholder (low contrast, see /audit) |
| #a3a3a3 | .dot, --panel-dim, .toast2 rail | Neutral status / disabled |
| #aaaaaa | .bubble.user .meta | Meta on ink bubbles |
| #d4d4d4 | .logpanel .logrow | Terminal secondary text |
| #8f8f8f | .logpanel .mono | Terminal timestamps |
| #4ade80 | .logpanel .badge.ok | Terminal green |
| #f87171 | .logpanel .badge.err | Terminal red |
| #fbbf24 | .logpanel .badge.warn | Terminal amber |
| #fbfbfb | .tbl th background | Table header |
| #fcfcfc | .tbl tr:hover, .auth-panel, .feed-row:hover | Subtle hover |
| #ececec / #f6f6f6 | .skeleton shimmer | Loading shimmer |
| #003a8c | .note text | Tint-acc foreground |
| #27272a | .bulkbar .btn:hover | Ink hover fill |
| #0070f3 | .flow-icon.ai, .cond-row.cond-category .cond-kind | Accent literal (token exists) |
| #d33 | .cond-remove:hover | OFF-PALETTE red — the only hard red that is not --err |
| #f0f7ff / #edfbf2 / #fff8ea / #fff1f1 | patterns + tints | Tint literals (tokens exist) |
| rgba(0,0,0,.10–.28) | menu/toast/scrim/drawer shadows | Elevation shadow values |
| rgba(250,250,250,.94) | .savebar, .topbar translucent | Backdrop fills |
Ink layer + tint pairings
status colour always travels with text
okwarn
erracc
solid
Informational note — interactive-subtle background, soft accent border, matching accent text.
Result banner — tint-ok / ok.
Warning banner — tint-warn / warn.
Error banner — tint-err / err.
1,204ink stat tile
7needs reply
03:11 info
terminal panels re-colour badges: #4ade80 / #fbbf24 / #f87171
Banner surfaces — paper (default) vs ink
paper is the default from design review; ink, tint and solid remain as variantsPaper (default) — light grey, black border, coloured left chip
Informational note
Success — saved.
Warning — saved, but partly.
Error — folder not found.
Ink variant (`.ink`) — solid black, black border, same chip
Informational note
Success — saved.
Warning — saved, but partly.
Error — folder not found.
Default surface is --surface-banner (paper): #f7f7f7 light,
#1e1e1e dark. The .ink variant uses --surface-banner-ink (solid black, both themes).
Status colour lives in the var(--bw-edge) (8px) left chip; highlights inside ink/solid banners use light-grey text
on a dark chip. Paper/tint keep the normal chip.
Banner styles — tint vs solid
alternates — swap .tint / .solid onto .msg (or .note)Tint — soft border, matching text
Informational note
Success — saved.
Warning — saved, but partly.
Error — folder not found.
Solid — full-saturation surface, white text
Informational note
Success — saved.
Warning — saved, but partly.
Error — folder not found.
Solid tokens: --interactive-solid,
--status-success-solid, --status-warning-solid,
--status-danger-solid; text is --text-on-ink (white).
Contrast with white: 6.06 / 4.84 / 5.02 / 4.96 — all pass 4.5:1 in both themes (checked by TDS011).
The token alias tier. The W3C DTCG format supports aliases ({color.accent}). To retheme safely, a semantic tier sits over the raw palette (e.g. surface.page → {color.bg}, text.secondary → {color.dim}, status.success → {color.ok}) so components stop reaching for primitives. tokens.json emits both tiers.
Architecture — two tiers, one theme file
- Primitives (47) hold raw values and are the only thing tokens.css defines: --bg, --acc, --ok… with dark values attached.
- Semantic aliases (46) are the product API: --surface-*, --text-*, --border-*, --interactive-*, --status-*, --ink-*, --code-*, --log-*, --dv-*. Core consumes aliases only; TDS012 flags primitives in product code.
- Dark mode is the same file: each primitive carries a com.triage.dark value and tokens.css emits prefers-color-scheme + [data-theme] overrides.
- Contrast is a gate, not a guideline: TDS011 checks the text/status/tint/solid pairs in both themes on every run.
- Decorative vs interactive borders: --border-default stays light by design; --control-border exists for the 3:1 control boundary.
Suggestions derived
- Sequential / diverging ramps: ordered data (heatmaps, scales) still needs a monochromatic ramp — the categorical 8 are for series only (F13 in the audit).
- Alias adoption in products: the tier exists but only the system core is guaranteed to use it; a codemod from primitive → alias is the cheapest retheme insurance.
- Strict 1.4.11 mode: if a downstream audit requires 3:1 for every visible boundary, switch decorative borders to --control-border and accept the heavier look.
- Print and email surfaces: ink panels need the paper rule (already in @media print); if the system grows marketing surfaces, add a dedicated print stylesheet.
Triage Design System v0.13.1-experiment — the central, app-agnostic UI design authority.
Source of truth: /tokens/tokens.json. Showcase chrome only:
site/.