Repository navigation
fix(web): let visitors pick light or dark on the product page - #22
Merged
Merged
Conversation
The product page only followed the system color scheme, so on a dark system it was always dark. It now has the same System / Light / Dark switch as the app, saved per browser and shared with the demo, and the screenshots follow the chosen theme. The theme logic moves out of App.tsx into a shared useTheme hook so both pages behave the same. Release v0.0.20.
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.
Problem
The product page only followed the system color scheme, so on a dark system it was always dark and visitors couldn't switch.
Fix
ThemeToggle), in the header on desktop and in the footer on phones.raidy-themelike the app's, so it survives reloads and carries over to the demo. The product page's startup script now matches the app's, so the saved theme applies before first paint.App.tsxintouseTheme()inweb/src/lib/theme.ts, so both pages behave the same.Release v0.0.20.
Tests
A new Playwright test, starting with the system in dark mode:
npm run check,format:check,build:pages, and the full Playwright suite (33 passed) all pass locally. I checked the switch's selected state and its look with screenshots.