Skip to content

Add prefers-color-scheme dark mode support#106

Open
inspector71 wants to merge 1 commit into
simonw:mainfrom
inspector71:dark-mode-support
Open

Add prefers-color-scheme dark mode support#106
inspector71 wants to merge 1 commit into
simonw:mainfrom
inspector71:dark-mode-support

Conversation

@inspector71

Copy link
Copy Markdown

Summary

  • Generated transcript pages only defined light colors on :root, so they stayed light-background regardless of the viewer's OS/browser theme.
  • Adds a @media (prefers-color-scheme: dark) block that overrides the same CSS custom properties with dark equivalents — no new CLI flag, existing output just follows the viewer's theme.

Test plan

  • Added test_dark_mode_media_query_present (TDD: confirmed it failed before the CSS change, passes after)
  • Updated the 4 full-page snapshot tests that capture the <style> block (--snapshot-update), verified the diff is limited to the new CSS lines
  • uv run pytest — 123 passed
  • black . — no changes needed

The generated transcript pages only defined light-mode colors via CSS
custom properties on :root, so they stayed light-background even when
the viewer's OS/browser was in dark mode. Add a
@media (prefers-color-scheme: dark) block that overrides those same
custom properties with dark equivalents, so pages generated by
generate_html follow the viewer's theme automatically with no new
CLI flag needed.
@inspector71 inspector71 changed the title Add prefers-color-scheme dark mode support Add prefers-color-scheme dark mode support Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant