Add dark mode - #16
Open
Copilot wants to merge 1 commit into
Open
Conversation
- Add CSS custom properties for light/dark themes in styles.css, toggled via html[data-theme] - Add ThemeToggle component that persists choice in localStorage and respects prefers-color-scheme by default - Wire toggle into Header - Add inline script in index.html to set the theme before first paint (avoids flash) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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
Adds a dark mode toggle to the app.
html[data-theme].ThemeTogglecomponent (sun/moon button in the header) that switches themes, persists the choice inlocalStorage, and defaults to the OSprefers-color-schemewhen no preference is stored.public/index.htmlsets the theme attribute before first paint to avoid a flash of the wrong theme.Testing
npm run dev, verified toggle switches themes, persists across reload, and screenshots confirm correct light/dark styling for the board, keyboard input, and header.