feat: add dark mode toggle with session persistence across reloads - #271
Merged
arisu6804 merged 3 commits intoJul 27, 2026
Merged
Conversation
Unclebaffa
force-pushed
the
feature/add-dark-mode-toggle
branch
from
July 25, 2026 18:36
3e84159 to
e912a85
Compare
Unclebaffa
force-pushed
the
feature/add-dark-mode-toggle
branch
from
July 25, 2026 18:40
e912a85 to
274bd06
Compare
Contributor
|
Solid change and easy to follow. Merged. |
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.
Detailed Implementation Summary
1. Theme State & Session Persistence
useLocalStorage('remitflow:theme', 'dark').'dark','light', and'system'.setTheme(mode),toggleTheme(), and computed propertyresolvedTheme.useEffecthook to set thedata-theme="dark"/data-theme="light"attribute ondocument.documentElementdynamically.prefers-color-scheme: dark) to dynamically update theme when set to'system'.2. Accessible UI Toggle Component
<ThemeToggle />button displaying Sun and Moon SVG icons depending on the current theme mode.aria-label={Switch to ${nextThemeLabel} mode}) and tooltiptitle.var(--color-surface),var(--color-text),var(--color-border)).3. Design System & CSS Tokens
:root,[data-theme="dark"], and[data-theme="light"]token declarations.--color-bg,--color-surface,--color-primary,--color-text,--color-muted,--color-border.Navbar.jsx.<ThemeToggle />in both desktop header actions and mobile drawer actions.#1f2a3a) tovar(--color-border).4. Code Quality & Prettier Formatting
npm run format): Fixed syntax errors inButton.stories.jsx,Chart.css,Chart.stories.jsx, andNavbar.stories.jsx. Passed Prettier code style checks 100%.5. Automated Unit & Component Testing
localStorage,data-themeattribute, and button accessibility attributes.localStorage.<ThemeToggle />presence in both desktop navigation and mobile drawer.npx vitest run test/unit test/components.6. Documentation
remitflow:theme).Closes #3