Skip to content

Add dark mode - #2

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/dark-mode
Open

Add dark mode#2
Copilot wants to merge 3 commits into
mainfrom
copilot/dark-mode

Conversation

Copilot AI commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Adds dark mode support to the Wordle game.

  • useTheme hook manages light/dark theme state, defaults to the OS prefers-color-scheme, and persists the user's choice in localStorage
  • Theme is applied via a data-theme attribute on <html>, with a full set of dark-mode CSS variable overrides (grays, success/warning/error, background/text) in styles.css
  • Sun/moon toggle button added to the Header to switch themes manually
  • Smooth color transitions on theme change; guess-input and board colors updated to use theme-aware variables

Testing

  • npx eslint on changed files: clean
  • npx parcel build public/index.html: succeeds

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Copilot and others added 3 commits August 6, 2026 18:28
- 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>
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