Skip to content

fix: make the hero code pane theme-aware, not always dark - #1183

Merged
vivek7405 merged 7 commits into
mainfrom
fix/stage-code-theme-aware
Jul 30, 2026
Merged

fix: make the hero code pane theme-aware, not always dark#1183
vivek7405 merged 7 commits into
mainfrom
fix/stage-code-theme-aware

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

Summary

  • The hero components/like-button.ts code pane hardcoded a near-black background and dark syntax colors in BOTH themes, so light theme showed what read as an unstyled black box.
  • Reproduced on the Railway origin directly (not the Cloudflare edge cache), confirming it's a real defect in the shipped code from feat(website): world-class brand and design system #1179, not a caching artifact.
  • Removed the .stage-code overrides in app/page.ts and public/input.css; the pane now uses bg-bg-elev + the shared .t-* token classes, same as every other code window on the page and in /docs.

Test plan

  • webjs check clean
  • npm test (unit + browser), 35/35 browser tests pass
  • Verified in a real browser, both themes: light now matches the "whole stack, in three files" panes, dark unchanged
  • Grepped for leftover .stage-code references, none found

Closes #1182

The hero's components/like-button.ts pane hardcoded a near-black
background and dark syntax colors unconditionally, so light theme showed
what read as an unstyled black box, inconsistent with every other code
window on the page and with /docs. Reproduced on the Railway origin
directly, so this was a genuine defect in the shipped code, not the
Cloudflare cache staleness found in the same QA pass.

Drop the .stage-code overrides and let the pane pick up bg-bg-elev plus
the shared .t-* token classes, the same theme-aware pattern the "whole
stack, in three files" code windows already use. The removed CSS custom
properties (--code-tag etc.) were dead weight: the highlight() tokenizer
renders .t-* classes, not those vars, so they were never read by the
markup that actually fills the pane.

Closes #1182
@vivek7405
vivek7405 marked this pull request as draft July 30, 2026 07:36
The components/like-button.ts pane was wider than the live-demo pane
(1.12fr vs 0.88fr); the source is short enough that the extra width
just added empty space. Flip the split to 0.92fr/1.08fr, still wide
enough that the longest sample line does not wrap.
0.92fr/1.08fr still read close to even; move to 0.8fr/1.2fr so the
code pane is clearly narrower than the live-demo pane while keeping
them side by side. The longest sample line still fits with no wrap.
The previous 0.8fr/1.2fr split overcorrected; back off to 0.88fr/1.12fr,
a modest step down from 0.92fr/1.08fr rather than another large jump.

Also shrink the stage's own container from max-w-6xl to max-w-5xl (a
single step down Tailwind's built-in scale) per a separate request to
reduce the combined LHS+RHS width, not just their split.
Use grid-cols-2 (Tailwind's built-in even-split utility) instead of an
arbitrary fr ratio, so the two panes are exactly equal width.
The whole-stack code windows, the hero pane, the mock panels under
'Modern full-stack, on web standards', and the file-list blocks under
'Start where you are' all used bg-elev (a raised surface) or bg-sunken
(a much deeper recess), while /docs code blocks use bg-subtle. A code
block reads as recessed into the page, not raised above it, which is
why /docs had it right and the home page was the outlier.

Switch all four surfaces to bg-subtle. --editor-bg (the small nested
pill/tag accents inside the Modern full-stack panels) is left on
bg-elev so those inner elements keep visible contrast against their
now-recessed container.
The INSTALL recipe (the npm create copy bar shown on the home,
why-webjs, and what-is-webjs pages, plus cta-panel.ts) mixed
bg-sunken into transparent, a darker base than the bg-subtle now used
by every code block on the same pages. Switch the base to bg-subtle,
keeping the 70% mix and backdrop-blur so it still reads as a floating
pill over the hero gradient rather than a flat card.
@vivek7405
vivek7405 marked this pull request as ready for review July 30, 2026 08:34
@vivek7405
vivek7405 merged commit d3afe6a into main Jul 30, 2026
10 checks passed
@vivek7405
vivek7405 deleted the fix/stage-code-theme-aware branch July 30, 2026 08:34
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.

fix: hero code pane ignores light theme, always dark background

1 participant