Repository navigation
Let the user choose a light, dark or system theme - #10
Merged
Merged
Conversation
Settings → Appearance offers System (the default, as before), Light and Dark. The choice is saved per browser and applied by an inline <head> script before the first paint, so a reload never flashes the other theme. - colour tokens use light-dark(); data-theme on <html> only sets color-scheme, so each colour is defined once - the Google map is created in the chosen scheme; the printable itinerary stays light - other tabs and OS theme changes are picked up live Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Settings → Appearance now offers 🖥️ System (default, the previous behaviour), ☀️ Light and 🌙 Dark.
localStorage), applied by an inline<head>script before the first paint – no flash of the wrong theme on reload, as in Next's Preventing flash before hydration guide.ThemeAgentre-applies it after React's dev-mode remount.globals.cssnow uselight-dark(light, dark);data-themeon<html>only setscolor-scheme, so every colour is still defined once.lib/theme.tsholds the pure parts (tested);lib/useTheme.tsthe browser hooks, excluded from coverage likelib/hooks.ts.Test plan
bun run typecheck,lint,test:coverage(169 tests),build<head>script alone sets it); Light wins over a dark OS; System follows the OS and clears the saved value🤖 Generated with Claude Code