Skip to content

feat: follow the reader's light or dark setting - #31

Merged
SurefireStudios merged 1 commit into
mainfrom
feat/light-theme
Sep 9, 2026
Merged

SurefireStudios merged 1 commit into
mainfrom
feat/light-theme

Conversation

@SurefireStudios

@SurefireStudios SurefireStudios commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #14.

Both surfaces share this stylesheet, so the light theme is a prefers-color-scheme: light block that redefines the tokens and nothing else. Every rule below stays written once and both themes get it, and the dashboard layer still defines no token of its own.

One correction to the issue

The issue says all colours are already tokens. Nineteen were not, and they were exactly the ones that break:

  • Raised surfaces were literal white overlays, rgba(255, 255, 255, a), in eighteen places: nav hover, table stripes, chips, the button's lit top edge. White on a white page is invisible, so the whole depth model would have flattened.
  • The sticky topbar carried the dark page colour, rgba(8, 9, 12, 0.82), so it would have floated a dark band over a light page while scrolling.

Rather than tokenise eighteen values separately, the overlays now multiply against a single --tint that inverts with the theme, preserving every existing alpha unchanged. The topbar gets a --scrim. That is two new tokens instead of eighteen, and it keeps the file's rule that depth is expressed one way.

The verdict colours are not the dark ones lightened

--pass, --fail and --review are chosen for near-black and do not hold contrast on white. They are darkened for the light theme instead of reused. The file's stated principle is that a verdict is read as a word and a glyph first, so colour is never the only signal, but it still has to carry, and the claim/reality contrast is still the one dramatic moment on the page.

Constraints respected

  • No new rule and no inline style, so the Content-Security-Policy is untouched.
  • The dashboard layer is not modified, so ships the product stylesheet verbatim as its base and defines no token or base component of its own both still hold.

Verification

  • apps/product and apps/dashboard tests: 79 passing, including the two that guard the shared-stylesheet arrangement and the one that fails the build on an inline style.
  • pnpm typecheck passes.
  • Checked in a browser in both schemes: light renders correctly across the topbar, hero, buttons, cards, the claim/reality panels and the verdict badges, and dark is unchanged.

Note

Low Risk

Overview
This pull request implements automatic light/dark theme switching based on the user's system preference via prefers-color-scheme: light media query in apps/product/src/client/styles.css. The change corrects a prior assumption that all colors were already tokenized by introducing tokens for nineteen previously-hardcoded values, including raised-surface overlays that used literal rgba(255, 255, 255, a) values. The structure keeps every non-tokenized rule written once and shared between themes, with the light theme only redefining token values while the dashboard layer continues to avoid defining tokens of its own. Overall, this enables both light and dark surfaces to share the same stylesheet while honoring the reader's OS-level theme setting.

Written by Gitzilla for commit de3b6bd. This will update automatically on new runs. Configure in the Gitzilla dashboard.

The product and the evidence dashboard were dark whatever the reader had
chosen. Both surfaces share this stylesheet, so redefining the tokens
under `prefers-color-scheme: light` gives both a light theme and leaves
every rule below written once.

Two things had to change before the tokens alone were enough. The issue
assumed every colour was already a token; nineteen were not. Raised
surfaces were painted with literal white overlays, `rgba(255, 255, 255,
a)`, which are invisible on a light page, and the sticky topbar carried
the dark page colour so it would have floated a dark band over a light
one. Both now come from tokens: a single `--tint` the overlays multiply
against, which inverts with the theme and preserves every existing alpha,
and a `--scrim` for the topbar.

The verdict colours are not the dark ones lightened. A judge reads a
verdict as a word and a glyph first, but the colour still has to carry, so
pass, fail and review are darkened to hold contrast against a white page
rather than staying shades chosen for near-black. The claim/reality
contrast is still the one dramatic moment on the page.

No new rule and no inline style, so the Content-Security-Policy is
untouched, and the dashboard layer still defines no token of its own.
Verified in both schemes in a browser; `apps/product` and `apps/dashboard`
tests pass, 79 of them.

Closes #14.
Copilot AI lite review requested due to automatic review settings September 9, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@SurefireStudios
SurefireStudios merged commit cf5c8c2 into main Sep 9, 2026
6 checks passed
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.

Dark mode for the product and the evidence dashboard

2 participants