Skip to content

Add automatic dark theme#39

Draft
g4bri3lDev wants to merge 1 commit into
mainfrom
feat/automatic-dark-theme
Draft

Add automatic dark theme#39
g4bri3lDev wants to merge 1 commit into
mainfrom
feat/automatic-dark-theme

Conversation

@g4bri3lDev

Copy link
Copy Markdown
Member

Follow the OS setting via prefers-color-scheme (no toggle, no JS). Most of the site is built on the --od-*/--fg/--bg token layer, so a dark override of the base color tokens in colors_and_type.css cascades to every page that uses var(...); inline styles and callouts were already tokenized or intentionally fixed (e-paper display-color swatches), so no per-page migration was needed.

  • colors_and_type.css: dark values for ink/paper/brand/semantic tokens and black-based shadows; swap the header logo mark to a white-outline variant via the content property so it tracks live scheme changes (an -referenced SVG's own media query only re-renders on reload).
  • logo-mark.svg: self-adapting outline (keeps the favicon in sync on load).
  • logo-mark-dark.svg: static white-outline variant for the live header swap.
  • common.css: align the legacy pages' dark palette with the main tokens and use dark ink for text on the accent button.

Verified in Chrome (both schemes, live switching): no light-on-dark leaks and no dark-mode contrast regressions across all pages.

Follow the OS setting via prefers-color-scheme (no toggle, no JS). Most
of the site is built on the --od-*/--fg/--bg token layer, so a dark
override of the base color tokens in colors_and_type.css cascades to
every page that uses var(...); inline styles and callouts were already
tokenized or intentionally fixed (e-paper display-color swatches), so
no per-page migration was needed.

- colors_and_type.css: dark values for ink/paper/brand/semantic tokens
  and black-based shadows; swap the header logo mark to a white-outline
  variant via the `content` property so it tracks live scheme changes
  (an <img>-referenced SVG's own media query only re-renders on reload).
- logo-mark.svg: self-adapting outline (keeps the favicon in sync on load).
- logo-mark-dark.svg: static white-outline variant for the live header swap.
- common.css: align the legacy pages' dark palette with the main tokens
  and use dark ink for text on the accent button.

Verified in Chrome (both schemes, live switching): no light-on-dark
leaks and no dark-mode contrast regressions across all pages.
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