Restore a theme control: OS by default, with an explicit override #36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "new-design-ux-pass"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Retiring the « Confort de lecture » bar removed the only thing that could
override
prefers-color-scheme, so the app rendered charbon for everyvisitor on a dark-mode OS with no way back to the charter's crème paper.
Diagnosed in-browser: prefersDark true, no data-theme on <html>,
--lfi-bg #212320. The vendored a11y widget can't substitute — it has no
light/dark control, and « Contraste clair » is a filter that paints white
boxes behind text while leaving the page charbon.
Three states, not a boolean: auto (default, OS decides) → clair →
sombre. On a dark-mode OS a two-position toggle can never reach light,
because "off" means no attribute, which lets the media query win, so
both positions render dark. "auto" has to be its own state, and
applyTheme("auto") must REMOVE the attribute rather than set anything.
aec-theme:v1key. Deliberately NOT theaec-prefs:v1blob leftbehind by the retired engine: a stale pinned theme in there would
silently defeat OS-by-default. That key is now orphaned in existing
visitors' storage and nothing reads it.
one; mirrors applyTheme().
that keeps it reachable at <=768px without opening the mobile menu. It
names its current state rather than flipping aria-pressed (three
states), mirrors that into a live region because a name change on the
focused element isn't announced reliably, and uses data-active to fill
the pill for the two pins so "auto" reads as the resting state.
Also corrects design.md and CLAUDE.md, which still described the comfort
bar as live — missed when it was removed. They now document the theme
contract, the inert data-fs/data-falc/data-contrast hooks, and why the
orphaned key isn't read.
npm run test 143/143 · typecheck clean · test:design-system 157/157 ·
test:legacy 6/6. Verified in the container: fresh visitor on a dark OS
gets auto/charbon; one click gives crème while prefersDark is still true;
a reload with light pinned stamps data-theme pre-paint with no flash.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com