fix(webapp): share page dark mode no longer shows white slabs (BEA-71) - #122
Merged
ssowonny merged 1 commit intoAug 5, 2026
Conversation
The share page already followed the system, but its dark @media block sat ABOVE the light pre/code/blockquote/table rules at equal specificity, so every light rule after it won. A dark-system visitor got a white frontmatter slab, a white code block and light-grey table borders on a near-black page — the surface strangers see first reading as a different product. Source order is the whole fix: the block moves to the end of the stylesheet and gets completed there, which repairs pre/code for free. Values are the hub's @theme tokens from frontend/src/tw.css instead of the hand-picked greys (#c6cbd3 body text, #3a3a44/#888 footer) that were the "different product" half of the complaint. Light mode is pixel-identical — only the dark block moved. Response headers (sandbox CSP, nosniff, referrer) are untouched. The test asserts placement, not presence: "a dark rule exists" passed while the page was still wrong, so it checks the dark block comes after the last light literal. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ssowonny
deleted the
bea-71-ph-scan-bug-public-share-page-renders-light-while-the-hub
branch
August 5, 2026 08:06
This was referenced Aug 5, 2026
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.
TL;DR
@mediablock just sat above the light rules at equal specificity, so every light rule after it won.pre/codefor free.tw.csstokens instead of hand-picked greys (#c6cbd3,#3a3a44,#888) — that ad-hoc palette was the other half of the complaint.What was actually broken
The spec listed four unthemed rules. It was six —
preandcodehad a dark override that never took effect, because it was declared before the light rules it was meant to beat.bodybg + text#c6cbd3text#0a0b0d/#eef0f3a#ffcf85)pre,codebackground#15171bblockquoteborder + textrgba(255,255,255,.07)/#9aa0a9td,thbordersrgba(255,255,255,.07)table.frontmatterbackground#15171btable.frontmatterborders + labelrgba(255,255,255,.07)/#868b93footer.bdrive,.updated#3a3a44/#888Values are the
@themetokens ininternal/webapp/frontend/src/tw.css, not picked by eye, which is what makes the two surfaces agree.The overrides use
border-left-color/border-color/border-bottom-colorrather than thebordershorthand, so the light rules keep owning width and style and only the colour is themed.Dark mode, before and after
Same document both sides: frontmatter table, blockquote, table, inline code, code block.
The one thing to actually check
That the diff contains no light-mode literal and no response header. Light mode has to be untouched, and
/s/*keeps its sandbox CSP /nosniff/ referrer policy (CLAUDE.md invariant — those live on the handler, not in this const, and nothing here goes near them).Evidence rather than assertion:
body,pre,code,blockquote,td,table.frontmatter,footermatch exactly on both sides.TestShareLastUpdatedStampalready asserts the three headers, and still passes.Test
TestShareDarkThemeIsLastasserts placement, not presence — deliberately. "A dark rule exists" passed while the page was still wrong, so the test checks the dark block comes after the last light literal (#f6f8fa,#d0d7de,#d8dee4,#6e7781,#57606a), covers each previously-light selector, and that no ad-hoc grey survived. It renders through the real handler, so thefmt.Sprintfformat string still has to work — a%that wasn't doubled would surface as%!, which the test also catches.Confirmed regression-shaped: reverted
shares.goand re-ran it — 6 failures.What was run
go build ./... && go vet ./...go test ./...npm run e2e#0a0b0d#eef0f317.25:1, dim 7.48:1, faint 5.75:1, link 13.61:1 — all past 4.5:1No syncer test: this touches no sync path. No frontend build: the CSS is a Go const,
internal/webapp/staticis untouched.Architecture
No diagram change — no types, seams or relationships moved. One CSS const and one test.
Deviation from the plan
None. The plan's own correction to the spec (six rules, not four; move the block rather than patch it in place) held up against the code.
Build session
Only works on the machine that ran the build.