Add dark mode - #2
Open
Copilot wants to merge 3 commits into
Open
Conversation
- Introduce useTheme hook that manages light/dark theme state, persists the choice in localStorage, and respects the user's prefers-color-scheme by default. - Add a sun/moon toggle button in the Header to switch themes. - Add dark theme CSS variable overrides (activated via html[data-theme="dark"]) plus background/text color variables and smooth transitions so the whole app (board, input, banners) reacts to the theme. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add useColorblindMode hook that tracks an on/off colorblind-friendly palette setting, persists it to localStorage, and sets a data-colorblind attribute on <html>. - Add a second toggle button (eye icon) in the Header, next to the theme toggle, to switch the palette on/off. - Add CSS overrides for html[data-colorblind='true'] that swap the green/yellow success & warning colors for an orange/blue palette (Okabe-Ito colorblind-safe palette), with a variant tuned for when dark mode and colorblind mode are both enabled. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the grayscale-based theme variables with a palette inspired by Monet's Water Lilies (navy, steel blue, olive green, sage green, dusty rose): - --color-success (correct guesses) now uses the olive green tone - --color-warning (misplaced letters) now uses the dusty rose tone - Neutral grays (header text/border, cell borders, incorrect tiles, input border) are now navy/steel-blue tints instead of true grays - --color-background uses a soft cool-white / deep navy tint for light/dark mode respectively - Dark mode variant brightens the accent hues for contrast on the deep navy background The colorblind-mode override (orange/blue) is unchanged and still takes precedence when enabled, since it serves a distinct accessibility purpose separate from the aesthetic palette. 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 dark mode support to the Wordle game.
useThemehook manages light/dark theme state, defaults to the OSprefers-color-scheme, and persists the user's choice inlocalStoragedata-themeattribute on<html>, with a full set of dark-mode CSS variable overrides (grays, success/warning/error, background/text) instyles.cssTesting
npx eslinton changed files: cleannpx parcel build public/index.html: succeedsCo-authored-by: Copilot 223556219+Copilot@users.noreply.github.com