Skip to content

fix: honor explicit light mode on dark-mode devices - #3

Merged
dhruvjainin merged 1 commit into
mainfrom
fix/explicit-light-theme
Oct 29, 2026
Merged

dhruvjainin merged 1 commit into
mainfrom
fix/explicit-light-theme

Conversation

@dhruvjainin

Copy link
Copy Markdown
Contributor

Summary

 applyTheme()
   toggle .dark
+  toggle .light with the opposite value

Mark both theme choices explicitly so Sprout does not fall back to the device dark preference after the visitor selects light. Device preference still applies until a choice is saved.

Evidence

  • Before: On a dark-mode device, selecting light removed .dark but left the page dark: computed canvas oklch(0.1826 0.002 264.5).
    After: Root uses .light, the canvas is oklch(0.9824 0.0013 286.38), and light persists across detail-page navigation. Maintainer reviewed the local result.
  • Six contract tests, build, typecheck and lint pass. Removing the light marker makes the new regression test fail. Tests cover both OS modes, saved preferences, clicks, OS changes and cross-tab changes.

Merge Danger

Door: two-way

Blast Radius: theme

Before choosing light still showed dark colors on a dark-mode device

After explicit light mode renders the light Sprout theme

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying tulipfarm-packages with  Cloudflare Pages  Cloudflare Pages

Latest commit: fbd11c8
Status: ✅  Deploy successful!
Preview URL: https://6ecc1948.tulipfarm-packages.pages.dev
Branch Preview URL: https://fix-explicit-light-theme.tulipfarm-packages.pages.dev

View logs

@dhruvjainin
dhruvjainin merged commit 414193c into main Oct 29, 2026
2 checks passed
@dhruvjainin
dhruvjainin deleted the fix/explicit-light-theme branch October 29, 2026 09:37
@dhruvjainin

Copy link
Copy Markdown
Contributor Author

Published and verified on https://packages.tulipfarm.ai: light mode now overrides a dark device preference and survives reload.

Verified light mode on the live canonical marketplace

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.

1 participant