Skip to content

fix(theme): keep the anonymous surface light so dark has no seam (#953) - #957

Merged
thinkclay merged 1 commit into
mainfrom
fix/953-marketing-light
Oct 2, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/953-marketing-light

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Closes #953. Your call on the issue: marketing stays light, pin the ground.

What was wrong

With dark on, the marketing pages rendered their own fixed palette on the app's near-black ground. Measured on /:

document.body       rgb(22, 17, 13)     colors.bg.dark.default   — themed
sections            rgb(255, 255, 255)  brand.surface            — fixed
hero                rgb(3, 69, 80)      brand.deep               — fixed
wash panels         rgb(232, 246, 249)  brand.tealWash           — fixed

features/marketing/theme.ts is deliberately not theme-aware — the file says so, and it is the one exception pinned in the literal ratchet (#819). So it is not getting a dark counterpart; the ground stops going dark instead.

Where it is pinned, and why there

In useThemeSetting. That is the single place both readers go through — ThemeBridge, which drives @scaffald/ui's provider, and InnerProvider, which stamps <html data-theme> and the page background.

Pinning only the background would have moved the seam rather than closed it: themed components inside would still have rendered dark on a light page.

The whole (public) group, not just the five marketing screens

(public) also holds public profiles, job pages, reviews and teams, and (public)/_layout.tsx mounts MarketingNav above every one of them. A dark job page under a light-palette nav is the same seam in a smaller frame.

So the anonymous surface stays light and the theme starts at the app proper. That is slightly wider than "the marketing pages", and deliberately so — flagging it because it is a scope judgement, not a mechanical consequence of the decision. / reports [] segments and is covered explicitly.

Verified against the running app

Flag on, stored preference dark, OS prefers-color-scheme: dark. Every one of these rendered dark before this change:

route data-theme body background
/ light rgb(255,255,255)
/terms light rgb(255,255,255)
/dashboard → /auth dark rgb(22,17,13)

The boundary holds in both directions — the app proper still goes dark, which is the half that would have been easy to break silently.

Notes

  • isLightOnlySurface takes the segments rather than calling useSegments, so it is testable without a router and only one caller is coupled to routing. It matches the group, not a path substring: ['(protected)', 'public'] is not the public group, and there is a test for that.
  • Per .radium/app-expo.md: useThemeSetting now re-runs on navigation, but the value handed to ThemeProvider is a string that only changes when crossing the boundary — so the 134-consumer re-render cascade that doc warns about is not widened.
  • 2151 tests, 0 failures (scf-core 1286, ui 714, app 98, schemas 53). pnpm prepush green.

With this, every token-level and structural item in the dark-mode work is done. What remains for #840 is the per-screen pass, which needs a local Supabase.

🤖 Generated with Claude Code

Closes #953. Decision (Clay, 2026-10-02): marketing stays light, pin the ground.

With dark on, the marketing pages rendered their own fixed palette on the app's
near-black ground — measured on `/`: body `rgb(22,17,13)` with sections at
`rgb(255,255,255)`, `rgb(3,69,80)` and `rgb(232,246,249)` straight out of
`features/marketing/theme.ts`. That palette is deliberate, documented as such in
the file, and the one exception pinned in the literal ratchet (#819), so it is
not getting a dark counterpart.

Pinned in `useThemeSetting`, which is the single place both readers go through:
ThemeBridge, which drives @scaffald/ui's provider, and InnerProvider, which
stamps `<html data-theme>` and the page background. Pinning only the background
would have left themed components rendering dark on a light page — the seam
moved rather than closed.

**The whole `(public)` group, not just the five marketing screens.** It also
holds public profiles, job pages, reviews and teams, and `(public)/_layout.tsx`
mounts `MarketingNav` above every one of them. A dark job page under a
light-palette nav is the same seam in a smaller frame, so the anonymous surface
stays light and the theme starts at the app proper. `/` reports `[]` segments
and is covered explicitly.

Verified against the running app with the flag on, a stored `dark` preference
and a dark OS — every one of these would have been dark before:

    /            data-theme=light   body rgb(255,255,255)
    /terms       data-theme=light   body rgb(255,255,255)
    /dashboard → /auth              data-theme=dark   body rgb(22,17,13)

So the boundary holds in both directions: the app proper still goes dark.

`isLightOnlySurface` takes the segments rather than calling `useSegments`, so it
is testable without a router and only one caller is coupled to routing. It
matches the group rather than a path substring — `['(protected)', 'public']` is
not the public group.

Per .radium/app-expo.md: `useThemeSetting` now re-runs on navigation, but the
value handed to ThemeProvider is a string that only changes when crossing the
boundary, so the 134-consumer re-render cascade that doc warns about is not
widened.

2151 tests, 0 failures (scf-core 1286, ui 714, app 98, schemas 53).

Co-Authored-By: Claude Opus 5 <[email protected]>
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.

Marketing pages render their light palette on the dark page ground

1 participant