Dark is the only theme - #704
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Light mode and the moon/sun toggle are gone. The dark values sit directly on
:rootrather 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, theprefers-color-schemefallback, 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-toggleto 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.jsrewritten: 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--paperfails 1, a restored[data-theme]block fails 3.