extension: dark mode for popup and extension pages - #400
Conversation
Runtime token layer (light + dark palettes) following prefers-color-scheme, SCSS-var-to-CSS-var migration on all popup/page stylesheets, paper grain re-expressed as light-catching texture in dark, commute rendered as a night scene with lit carriage, and the portrait kept as a light paper sheet in a darkened room. Design spec: internal-docs/2026-08-17-extension-dark-mode.md
Deploying we-were-online-website with
|
| Latest commit: |
4c9cd5d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://060198df.we-were-online-website.pages.dev |
| Branch Preview URL: | https://cd-extension-dark-mode-36bb7.we-were-online-website.pages.dev |
Preview evidenceFresh Chromium proof that popup controls and synchronized commute notices retain dark mode after merging current main. Open preview · Review all evidence · Commit Popup Slow Mode settings after current-main mergeThe freshly built popup keeps readable dark tokens across the wordmark, commute card, sharing selector, controls, and page texture. Open captured page · 400×800 Synchronized commute notices after current-main mergeThe freshly built commute page keeps the warm night scene while the sharing notice and live route-update notice remain legible. Open captured page · 1280×900 Published by PR Evidence. Media is temporary and is removed after retention expires. |
Code review
|
commit: |
Injected shadow-DOM surfaces (satchel, emote wheel, toasts, bottle,
historical overlay, presence pill) now follow the host page's apparent
theme, detected from effective background luminance with a
prefers-color-scheme fallback. Tokens are set inline on each shadow host
since :host { all: initial } blocks :root inheritance.
…e-36bb70 # Conflicts: # extension/PENDING.md # extension/src/entrypoints/walking-record/walking-record.tsx
|
Re: the code review sweep — both findings were addressed in 5e5a2e9 (it landed after the reviewed head 33f2b65):
Also merged |
Deploying playhtml with
|
| Latest commit: |
32ec30d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0f07da32.playhtml.pages.dev |
| Branch Preview URL: | https://cd-extension-dark-mode-36bb7.playhtml.pages.dev |
Code reviewNo issues found. Verified the changes addressing the previous review findings. |
…e-36bb70 # Conflicts: # extension/PENDING.md


Summary
Adds dark mode to the extension in two phases, both in this PR:
Phase 1 — extension surfaces (popup, options/setup, portrait, stats, commute, scraps, walking-record, color-picker) follow the OS setting via
prefers-color-scheme(no in-app toggle).Phase 2 — injected in-page UI (inventory satchel, emote wheel, milestone toasts, message bottle, historical overlay, presence pill) follows the host page's apparent theme instead of the OS: a dark satchel floating on a light website reads as broken even for dark-mode OS users. Theme is detected from the page's effective background luminance (body/html composited over white, threshold 0.4), falling back to
prefers-color-schemewhen indeterminate. Tokens are written inline on each shadow host since:host { all: initial }blocks:rootinheritance; one shared TS token map (injected-ui-theme.ts) mirrors_variables.scss.Design spec:
internal-docs/2026-08-17-extension-dark-mode.md(not committed).Design
Implementation
_variables.scss/_base.scsswith a dark block; all in-scope stylesheets migrated from compile-time SCSS$vars tovar(--*).<meta name="color-scheme" content="light dark">on every entrypoint (fixes UA form controls going dark on their own).portrait-styles.scssusesvar(--*, <light fallback>)so the website (no dark tokens) is unchanged.inject-ui.tsgained a theme option;HistoricalOverlay.scssfound to be dead (never imported) and left untouched — the live inline styles inHistoricalOverlay.tsxwere themed instead.PresenceCountPillrenders in light DOM, so it takes literal values from the token map at creation instead of CSS vars, avoiding collisions with host-page custom properties.Verification
bun run check:extensionclean;bun run test:extension806/806 pass; WXT production build succeeds.Release notes for both phases added to
extension/PENDING.md.