Dark-mode readability pass: soften the palette, bump the root type scale
release gate / check (push) Failing after 6m31s
release gate / check (push) Failing after 6m31s
A user reported dark mode (white-on-black) is harder to read than light mode. Root cause is halation, not size alone: the dark tokens ran 98% foreground on a 3.9%-lightness background (~19:1 contrast), and bright text on near-black visually bleeds — worst for astigmatic readers, and light-on-dark renders perceptually thinner at the same size. Palette (web/app/globals.css .dark tokens): background 3.9% -> 10%, foreground 98% -> 92% (body contrast ~13:1, still ~2x WCAG AAA), card/popover 6% -> 13%, sidebar 5.5% -> 8% (stays darker than content), secondary/muted/border/input 15.9% -> 19% so surface steps survive the lighter base; muted-foreground unchanged at ~7.4:1 (AAA). Type scale: html root 106.25% (16 -> 17px) — a global bump, so every rem-based text AND spacing scales proportionally in both themes. Deliberately not per-theme: a dark-only font size would reflow layouts on every theme toggle. Font-smoothing left untouched (the antialiased-off trick is a pre-Mojave artifact and risks blur). STYLE_GUIDE.md records both decisions, including a dark-theme readability rule (keep body copy ~11:1-14:1; never reintroduce pure white on <5% backgrounds) so future token work cannot silently undo this. Web lint/SSR-eslint/build clean. CI browser regressions are the gate to watch for the 6.25% global scale-up.
This commit is contained in:
@@ -22,6 +22,10 @@ The root layout, `app/layout.tsx`, is the single place for app-wide providers an
|
||||
|
||||
**Size hierarchy:** Use Tailwind's scale. Headings: `text-4xl`→`text-3xl`→`text-2xl`→`text-xl`. Body: `text-base`→`text-sm`. Captions: `text-xs`.
|
||||
|
||||
The root font size is `106.25%` (17px) in `globals.css` — a deliberate global
|
||||
bump; every rem-based size and spacing scales with it. Change it there only,
|
||||
never per-theme (a per-theme font size reflows layouts on every toggle).
|
||||
|
||||
Always use `tracking-tight` on large headings (`text-2xl` and above).
|
||||
|
||||
---
|
||||
@@ -45,6 +49,14 @@ All colors use CSS variables — **never hardcode color values**.
|
||||
|
||||
Usage: `bg-primary`, `text-muted-foreground`, `border-border`, etc.
|
||||
|
||||
**Dark-theme readability rule:** the `.dark` tokens target ~13:1 body-text
|
||||
contrast, not maximum. The original near-black bg (3.9% lightness) with
|
||||
near-white text (98%) measured ~19:1 and caused halation (bright-on-black
|
||||
text visually bleeds, worst for astigmatic readers) — user-reported
|
||||
2026-10-29. When adding dark tokens keep body copy between ~11:1 and 14:1
|
||||
(WCAG AAA is 7:1); never reintroduce pure `0 0% 100%` foreground on
|
||||
`<5%` backgrounds.
|
||||
|
||||
---
|
||||
|
||||
## Spacing Scale
|
||||
|
||||
Reference in New Issue
Block a user