Skip to content

Enhancement os aware dark/light theme persistence#223

Merged
johdanike merged 2 commits into
SwiftChainn:mainfrom
amoduenechojo:Enhancement-OS-Aware-Dark/Light-Theme-Persistence
Jul 1, 2026
Merged

Enhancement os aware dark/light theme persistence#223
johdanike merged 2 commits into
SwiftChainn:mainfrom
amoduenechojo:Enhancement-OS-Aware-Dark/Light-Theme-Persistence

Conversation

@amoduenechojo

Copy link
Copy Markdown
Contributor

#closes
#166

The theme experience now behaves as requested:

The app checks the user’s OS preference with matchMedia on initial load.
A manual theme choice is saved to localStorage and takes precedence over the OS default.
A blocking inline script applies the theme class before React hydrates, preventing the opposite theme from flashing.
What changed
Added browser-side theme initialization and persistence logic in themeService.ts
Updated the theme hook in useTheme.ts to initialize from stored/local preference first, then fall back safely
Wired the pre-hydration theme script into layout.tsx
Kept the theme provider aligned in providers.tsx
Added regression coverage in useTheme.test.ts

@drips-wave

drips-wave Bot commented Jul 1, 2026

Copy link
Copy Markdown

@amoduenechojo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@johdanike johdanike merged commit 6d6f3a1 into SwiftChainn:main Jul 1, 2026
0 of 2 checks passed
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.

2 participants