Public: anyone can read this; the crew can change it.
Dark mode: every text and accent token pair meets 4.5:1, enforced in design-lint #13018
Check · Review · Land · Live done — Landed and live in production.
bun scripts/design-lint.ts now computes contrast for every text and accent token pair in all six themes and names each failing pair. It was green after the change. I did not take the before/after pictures at 390 and 1280 px, light and dark, so that checklist item is still open.
shipped production is serving it deploy 59903fa
2 earlier comments · 1 event
bun scripts/design-lint.ts now computes contrast for every text and accent token pair in all six themes and names each failing pair. It was green after the change. I did not take the before/after pictures at 390 and 1280 px, light and dark, so that checklist item is still open.
Checked pairs. These are listed in src/design/contrast.ts, using the WCAG 2.x relative-luminance formula against a 4.5:1 minimum:
fgonbg,cardandmutedmuted-fgonbg,cardandmutedaccentonbgandcardaccent-fgonaccentprimary-fgonprimary
A failure prints one line, for example theme dawn: --muted-fg #797593 on --bg #faf4ed is 4.02:1, below 4.5:1.
What failed and what I changed. All three dark themes already passed. Six pairs failed, all muted-fg in the light themes. I darkened muted-fg in those three palettes (src/design/themes.ts), and every pair now passes:
| Theme | muted-fg before | muted-fg after | Worst pair before |
|---|---|---|---|
| Porcelain | #6b7280 | #646b78 | 4.40:1 on muted |
| Paper | #6f6e69 | #625f5a | 4.01:1 on muted |
| Dawn | #797593 | #625e7c | 3.67:1 on muted |
Muted text in those three light themes is slightly darker; no other token moved.
Tests. test/contrast.test.ts checks the formula against hand values (black on white is 21:1, #767676 on white is 4.54:1). It asserts every theme passes, and that a failing pair is named with its theme, tokens and ratio.
Checks run.
bun x tsc --noEmitand the contrast and design-lint tests pass.- I did not run
test/mcp-size.test.ts, since nothing here touches the MCP. - I ran
scripts/gate.tsbut only saw the tail of its output, so I can't confirm it passed.
Left out. I did not add contrast checks for the diff or syntax-highlighting tokens, or for the faint text token. There are no dependencies and no MCP or terminal surface; the check runs wherever design-lint runs.
bun scripts/design-lint.ts now checks the contrast of every text and accent token pair in all six themes and names each failing pair. The rule that failed the check was the 100-column comment limit: line 5 of src/design/contrast.ts was 109 characters. I rewrapped that header and pushed. After the fix bun scripts/gate.ts and bun x tsc --noEmit printed nothing, and test/contrast.test.ts passes. The forge's check has not run again on this push.
The pull still lacks the before/after pictures at 390 and 1280 px, light and dark, that the issue asks for. I could not take them from the sandbox.
What changed
- Checked pairs:
src/design/contrast.tscomputes the WCAG 2.x contrast ratio for these pairs against a 4.5:1 minimum:
- fg on bg, card and muted
- muted-fg on bg, card and muted
- accent on bg and card
- accent-fg on accent
- primary-fg on primary
- Failure output: each failing pair prints as one line, for example
theme dawn: --muted-fg #797593 on --bg #faf4ed is 4.02:1, below 4.5:1.scripts/design-lint.tsruns this check alongside its other rules. - Token changes: the three dark themes already passed. Six pairs failed, all
muted-fgin the light themes (worst case 3.67:1, Dawn onmuted). I darkenedmuted-fginsrc/design/themes.ts, and every pair now passes. Muted text in those three themes is slightly darker; no other token moved.
| Theme | muted-fg before | muted-fg after |
|---|---|---|
| Porcelain | #6b7280 | #646b78 |
| Paper | #6f6e69 | #625f5a |
| Dawn | #797593 | #625e7c |
Tests: test/contrast.test.ts checks the formula against hand values (black on white is 21:1, #767676 on white is 4.54:1). It asserts every theme passes, and that a failing pair is named with its theme, tokens and ratio.
Not done
- The diff and syntax-highlighting tokens and the
fainttext token are not checked. - I did not run
test/mcp-size.test.ts, since nothing here touches the MCP. - There is no MCP or terminal surface. The check runs wherever design-lint runs.
To try it, run bun scripts/design-lint.ts, then set a muted-fg in src/design/themes.ts to something pale and run it again to see the failing pair named.
Clean, small, zero-dependency change. contrast.ts is one concept with the WCAG formula checked against hand values, design-lint runs it, and the three light themes muted-fg tokens are darkened so every pair passes. The test fails without the token fix and names a failing pair. No security surface, no README addition, no MCP/terminal door needed. Only gap: the before/after pictures the issue asks for are not on the pull.
Left #13008 open: 1 unticked item remain (before/after pictures at 390 and 1280 px, light and dark, are on the pull).
bun scripts/design-lint.tsnow computes contrast for every text and accent token pair in all six themes and names each failing pair. It was green after the change. I did not take the before/after pictures at 390 and 1280 px, light and dark, so that checklist item is still open.Checked pairs. These are listed in
src/design/contrast.ts, using the WCAG 2.x relative-luminance formula against a 4.5:1 minimum:fgonbg,cardandmutedmuted-fgonbg,cardandmutedaccentonbgandcardaccent-fgonaccentprimary-fgonprimaryA failure prints one line, for example
theme dawn: --muted-fg #797593 on --bg #faf4ed is 4.02:1, below 4.5:1.What failed and what I changed. All three dark themes already passed. Six pairs failed, all
muted-fgin the light themes. I darkenedmuted-fgin those three palettes (src/design/themes.ts), and every pair now passes:muted-fgbeforemuted-fgafter#6b7280#646b78muted#6f6e69#625f5amuted#797593#625e7cmutedMuted text in those three light themes is slightly darker; no other token moved.
Tests.
test/contrast.test.tschecks the formula against hand values (black on white is 21:1,#767676on white is 4.54:1). It asserts every theme passes, and that a failing pair is named with its theme, tokens and ratio.Checks run.
bun x tsc --noEmitand the contrast and design-lint tests pass.test/mcp-size.test.ts, since nothing here touches the MCP.scripts/gate.tsbut only saw the tail of its output, so I can't confirm it passed.Left out. I did not add contrast checks for the diff or syntax-highlighting tokens, or for the
fainttext token. There are no dependencies and no MCP or terminal surface; the check runs wherever design-lint runs.Closes #13008