Add toggleable dark theme + reduced-motion guard (TraitMech site)#149
Merged
Conversation
Adds a user-toggleable dark theme (OS prefers-color-scheme default, with a data-theme toggle persisted to localStorage) and a reduced-motion guard to every generated page, without changing the light appearance. - Vendor theme-toggle.js at the web root (pages/theme-toggle.js), self-contained fixed ☾/☀ button that themes from the page tokens. - style.css: append dark token remap (both @media prefers-color-scheme:dark and :root[data-theme="dark"]) + hard-coded-color overrides (site-header, hero, .stat, buttons, pathograph container/legend, graph-warning, edge-evidence) + d3 scatter SVG legend text fill / hover halo + reduced-motion guard. Covers browse/category/trait/umap/graph pages that link assets/style.css. - base.html: include theme-toggle.js at end of body (propagates to all base-derived pages via re-render). - index.html (standalone landing): inline dark block mapping --pastel-b→--bg and --pastel-a→heroA (page/footer ground goes dark, hero fades to dark), translucent .stat/footer surfaces dimmed, .btn text darkened, reduced-motion guard, include. - Re-rendered with scripts/render_trait_pages.py (477/477 trait pages). Additive only; the base :root token blocks are untouched so the light look is identical. umap/graph SVG theming is handled entirely by the style.css dark rules, leaving those templates' HREF_BY_ID click-through fix untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 tasks
Contributor
Author
|
Reviewed the PR's own diff (base Clean — no issues, and correctly additive.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a user-toggleable dark theme (OS `prefers-color-scheme` default plus a `data-theme` toggle persisted to `localStorage`) and a reduced-motion guard to every generated TraitMech page, without changing the light appearance.
What changed
Palette (dark)
bg `#171417` · surface/card `#211d20` · ink `#efeaea` · muted `#ada4a6` · border `#332d30` · accent `#ef7377` · heroA `#33201f` · code-bg `#0d0b0d` · accent-soft `#2a1e1f`
Verification
Additive-only; DO NOT MERGE (stacked on `fix/embedding-clickthrough-404`).
🤖 Generated with Claude Code