Repository navigation
feat(website): add a persistent light and dark theme switch - #2432
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Self-review at Reviewed the final shared head/header templates, the theme state owner, CSS specificity, canvas consumer, generated HTML and catalog semantics.
Validation: 12 website regressions, strict 18-catalog coverage and GNU format checks, 152 Chromium matrix cases, 57 follow-up scenarios, formatting, typecheck/lint and diff checks pass. Browser execution used Chromium; other engines were not executed. No production publishing workflow was run. |
Add a sun/moon button beside the language selector. A first visit follows the system preference; a manual choice is remembered across pages, language editions and tabs on the same host. Keyboard users get a translated action label and a 44px button.
One shared head script applies the theme before styles load and owns the resolved theme, browser color and change event. The existing palettes, embedded SVGs and dinosaur canvas follow that choice. Storage failures leave the current-page switch usable; delayed cross-tab notifications read the latest saved value. Without JavaScript, pages remain light and the switch is hidden.
The shared page scaffold, maintenance guide and regression check cover the new theme region. Fix the Get started button's hover background to use the theme palette. Catalog changes add two reviewed labels in all 18 translations; existing translations are unchanged, and most PO changes are regenerated source references.
Validation:
website.py check: 12 regression tests; 325 HTML pages, 323 indexed routes and 20,793 local references verified./and/rea/.npm run check:fast, formatting andgit diff --checkpass.