Fix Theme Switching Issue & Two Factor QR Code for dark mode #179
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.
Issue
The theme switcher didn’t update component appearances instantly when the theme changed. When using only
appearancefromuseAppearance, components didn’t always receive the latest theme value from the hook.Additionally, some components (like Stripe) don’t need the
systemtheme value. For example, when i implementing a Stripe theme that matches the site’s light or dark mode colors, i had to manually handlesystemchecks each time.To simplify this, I introduced
resolvedAppearancein theuseAppearancehook, it always returns eitherlightordark, removing the need for extra logic.Also cleaned up the
useAppearancehook by removing duplicate code and making it more efficient.Fix:
Also fixed for vue-starter-kit
Theme Switching Issue Demo
Screen.Recording.2025-10-07.222222.mp4
Before & After QR Code Visibility
Update: 2025-10-21
useStatewithuseSyncExternalStore