Repository navigation
feat(website): follow the system dark mode and fix small-screen text - #1894
Conversation
…spacing From a layout audit of the built pages: - Long terminal prompts and code-header buttons wrap instead of being cut off at 320px (WCAG 1.4.10). - Headings and table cells break long words, so the 1.4.12 text-spacing test no longer widens pages past 320px. - Header and footer links get a 24px minimum height (2.5.8). - Labels that rendered under 12px now render at 12px or more, and inline code never drops under 0.75rem. - The home page's hero and definition rows share one column gap and align on the first baseline, and stacked boxes share one corner size. - Highlight chips get room around the text, and the active run in a step listing is one band instead of a box per line. Colors are unchanged. 🤖 Generated with Claude Code (Sonnet 5.5) 🦊
The site was light only, so a reader with a dark system still got a white page. Add one prefers-color-scheme: dark block to the stylesheet that swaps the six color variables to Catppuccin Mocha (MIT) and overrides the fixed colors that would break on a dark page: selection, buttons, tinted highlights, flow nodes and arrows, and a visible border on the agent terminal. Add a dark theme-color tag beside the light one in the page template and the 17 pages, and a Dark column to the style guide's color table. Light colors are unchanged. The SVG figures follow in the next commit; the blog page's inline strokes, the dinosaur game and the social card are left as they are. 🤖 Generated with Claude Code (Sonnet 5.5) 🦊
Pages load the figures with <img>, so page CSS cannot reach inside them. Each figure now carries its own @media (prefers-color-scheme: dark) block of attribute-selector overrides that map every light color to a Catppuccin Mocha color, with one shared map across all five. No markup, labels, shapes or positions change, and nothing uses !important. Four figures also paint a mantle canvas so "Open figure" works on its own; analyst-thinking.svg stays transparent, since it sits on the page rather than in a figure box. 🤖 Generated with Claude Code (Sonnet 5.5) 🦊
The theme-color tags move the page lines that the catalogs cite, so python3 scripts/website.py translations extract rewrites the source references in messages.pot and the 18 PO files. No message text changes. The same run moves the "Main navigation" entry to its new position in each catalog. 🤖 Generated with Claude Code (Sonnet 5.5) 🦊
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 754f3ec52c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The full-width band for the active step now applies only to code-step blocks. The inline parameter highlights in the dx-ball and th04 signatures stay inline again. 🤖 Generated with Claude Code (Opus 5.5) 🦊
Each authored reading page, and its built copy in every language, must carry one theme-color tag for light and one for dark. The stylesheet must keep its dark color scheme block. On the commit before dark mode, this test fails on every page. 🤖 Generated with Claude Code (Opus 5.5) 🦊
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4f252518ce
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
In dark mode the game box turned dark, but the game still drew with its light colors, so the dinosaur, cacti and text fell to about 2:1 contrast. The canvas now reads five colors from CSS variables on .dino-stage. Light values are the old ones, so light mode draws the same pixels. Dark values are Catppuccin Mocha: 8.3:1 for the dinosaur, 7.9:1 for cacti and text, 7.6:1 for the crash color. The moved lines in dino-demo.js shift the translation catalog references, so the catalogs are refreshed too (reference comments only). 🤖 Generated with Claude Code (Opus 5.5) 🦊
Rendered in headless Chromium 154 from the morluto#1894 head b9ef65d, at 2x scale. 🤖 Generated with Claude Code (Opus 5.5) 🦊
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9ef65dded
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The inline flywheel SVG on the Touhou article hard-codes its stroke colors, so on the dark page its connectors fell to about 2:1. Two dark-only rules map those strokes to the page accent and muted colors (7.8:1 and 7.4:1). Light mode is unchanged. 🤖 Generated with Claude Code (Opus 5.5) 🦊
The canvas reads its colors only when it draws, so an idle, paused or crashed game kept the old palette after a theme switch. Each demo now redraws on a prefers-color-scheme change. The added lines shift the translation catalog references, so the catalogs are refreshed too (reference comments only). 🤖 Generated with Claude Code (Opus 5.5) 🦊
|
TL;DR: All four review notes are fixed, and a new site test guards the dark theme tags. Light mode still looks the same. What changed since I opened this:
For each fix, I checked that light mode draws the same pixels as before. The site check and the pre-push checks pass. The body now notes that the scope grew. I can split the PR if that helps. 🤖 Generated with Claude Code (Opus 5.5) 🦊 |
Rendered in headless Chromium 154 from the morluto#1894 head 9e0e445, at 2x scale. 🤖 Generated with Claude Code (Opus 5.5) 🦊
|
Looks good thank you for this Cassie! |
TL;DR: The website now turns dark when the reader's system is set to dark. The same PR fixes small text and spacing problems that show in both modes. Light colors do not change.
Summary
The plan is in discussion #1727. Thanks, morluto, for the go-ahead. The site only had a light theme. With a dark system, readers got a white page. This PR adds a dark theme. It also fixes small layout problems that I found while measuring the pages.
Scope grew in review. This PR is bigger than the plan in #1727. The automated review found four places where dark mode made things worse. I fixed them here. They are the step highlight, the dinosaur game colors and its redraw, and the Touhou flywheel arrows. A new site test came too. If smaller pieces are easier to review, I can split it.
Problem and expected behavior
Change and scope
The first four commits are the change, and each can be read alone. Five more came after review. They hold the four review fixes and a new site test.
@media (prefers-color-scheme: dark)block sits instyles.css, before the right-to-left rules. It swaps the six color variables to Catppuccin Mocha (MIT). It also setscolor-scheme: dark. Fixed colors that would break on a dark page get dark values. The terminals get a border. The page template and the 17 pages get a secondtheme-colortag for dark. The style guide's color table gets a Dark column.python3 scripts/website.py translations extractrewrites them. This commit is that run, unedited. It changes 19 files and about 31,600 lines. The changes are#:reference comments and one moved entry ("Main navigation"). Nomsgstrtext changes. Without it, the site check fails. The error is "Translation sources changed". You can skip it when reviewing. You can also re-run the command yourself.The translated pages need no extra CSS. The build makes them from the English pages. They load the same stylesheet. The language picker and the translation notice use the color variables. The right-to-left rules set no colors.
Not in this PR: the sharing image. It stays light. Link previews ignore the system setting.
Screenshots
These are placeholder previews from my fork build, made before the port to today's main. They show the look, not this exact branch.
Contract and boundary impact
docs/public/product-catalog.json), package, or installation impact: none.Evidence and regression coverage
All numbers below were measured on the built site. I read computed styles in headless Chromium. I judged no looks from screenshots.
scripts/test-website.py. Every reading page, and its built copy in each language, must have a light and a darktheme-colortag. The stylesheet must keep its dark block. On fa9a7e5, before this PR, the test fails on every page. On this branch it passes. The other site tests still cover the pages, links and metadata.theme-colortags.notes-electronandnotes-web. They are sample apps, and this PR does not touch them. The 323 reading pages are 17 pages in each of 19 languages.!important: none added..dino-stage. In light, its pixels match the old ones byte for byte on both pages that host it. In dark, the dinosaur is 8.3:1, cacti and text 7.9:1, and the crash color 7.6:1. The game redraws when the system theme changes, even while idle.Not run
Validation performed
All ran on this branch.
The copy was clean, under
/tmp. The Node version was 24.18.0.python3 scripts/website.py check: exit 0.python3 scripts/test-website.py: exit 0, 12 tests, with the new one.npm ci: exit 0.npm run check:fast: exit 0. This needed a git repository in the copy, because the lint step lists files with git.npx oxfmt --check website scripts: exit 0.Compatibility, safety, and release
Review checklist
type(scope): outcome. Two parts by choice, agreed in [Feature] Dark mode for rea.tools, plus a few small fixes for phones and accessibility #1727.Test setup
🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊