Skip to content

Dark is the only theme - #704

Merged
MikeyPetrillo merged 2 commits into
mainfrom
claude/sweet-brown-i99jl3
Aug 6, 2026
Merged

Dark is the only theme#704
MikeyPetrillo merged 2 commits into
mainfrom
claude/sweet-brown-i99jl3

Conversation

@MikeyPetrillo

Copy link
Copy Markdown
Owner

Light mode and the moon/sun toggle are gone. The dark values sit directly on :root rather than behind a [data-theme] attribute, so the first paint is already correct with no script, no localStorage, and nothing to desync.

Removed: the pre-paint theme script, a402ToggleTheme, the stored preference, the prefers-color-scheme fallback, the toggle button, its CSS, and the moon/sun glyphs.

Two things that would have shipped broken

The revenue chart carried its dark series colours under :root[data-theme="dark"] .rvz. With the attribute gone that rule could never match, so the chart would have kept its light palette on a permanently dark page. Legible, and therefore easy to miss in review.

The first removal pass matched from .ml-theme-toggle to end of line, stranding :root[data-theme="dark"] before the next comment and producing a malformed selector, the kind that silently invalidates the rule after it. Redone with whole-line removal; brace balance and a stranded-selector check are asserted.

Test

test-theme.js rewritten: it asserted the old contract in fourteen places, and its final assertion "light is the default" passed for entirely the wrong reason. 19 assertions now pin the palette, the absence of every part of the toggle mechanism, CSS integrity, and the chart palette. Mutation-tested: a light --paper fails 1, a restored [data-theme] block fails 3.

MikeyPetrillo and others added 2 commits August 6, 2026 10:53
Puts /revenue and /status in the sticky nav and the mobile menu, where they
were previously reachable only from the footer at 97% of the page. Markup and
CSS only: no new variable, so the upsert is a no-op and cannot race the pinned
deploy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Light mode and the moon/sun toggle are gone. The dark values now sit directly
on :root rather than behind a [data-theme] attribute, which matters for more
than tidiness: an attribute-applied palette needs JavaScript to set it, so
there is a frame of the wrong colour before the script runs, plus a stored
preference that can disagree with the markup. On :root the first paint is
already correct with no script, no localStorage and nothing to desync.

Removed: the pre-paint theme script, a402ToggleTheme, the stored preference,
the prefers-color-scheme fallback, the toggle button, its CSS, and the
moon/sun glyphs.

TWO THINGS THAT WOULD HAVE SHIPPED BROKEN.

The revenue chart carried its dark series colours under
`:root[data-theme="dark"] .rvz`. With the attribute gone that rule could never
match, so the chart would have kept its LIGHT palette on a permanently dark
page - still legible, which is exactly why it would have survived review. The
dark palette is now the only one.

And the first removal pass matched from `.ml-theme-toggle` to end of line,
which stranded `:root[data-theme="dark"] ` in front of the following comment
and produced a malformed selector, the kind that silently invalidates whatever
rule comes after it. Redone with whole-line removal; brace balance and a
stranded-selector check are both asserted now.

test-theme.js is rewritten for the new contract, since it asserted the old one
in fourteen places and its last assertion, "light is the default", passed for
entirely the wrong reason. It now pins the palette, the absence of every part
of the toggle mechanism, the CSS integrity checks above, and the chart palette.
One assertion is deliberately narrow: it matches `data-theme=` and
`[data-theme`, not the bare word, because the CSS comment explaining why the
attribute is gone legitimately contains it, and a test that fails on its own
documentation is testing prose rather than behaviour.

Mutation-tested: restoring a light --paper fails 1, restoring a [data-theme]
override block fails 3.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@MikeyPetrillo
MikeyPetrillo merged commit 45c865f into main Aug 6, 2026
38 of 40 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.

1 participant