Skip to content

feat: improve theme handling with system preference and FOUC prevention#7

Merged
markwylde merged 1 commit into
mainfrom
feat/improve-theme-handling
Aug 9, 2025
Merged

feat: improve theme handling with system preference and FOUC prevention#7
markwylde merged 1 commit into
mainfrom
feat/improve-theme-handling

Conversation

@markwylde

Copy link
Copy Markdown
Owner

Summary

  • Adds system theme preference detection as fallback when no saved preference exists
  • Implements automatic theme switching when system preference changes
  • Applies initial theme before React mount to prevent flash of unstyled content (FOUC)
  • Enhances segmented control styling with better focus states and active styling

Test plan

  • Verify theme persists across page refreshes
  • Test system preference detection when no saved theme
  • Confirm automatic switching when system preference changes
  • Check for FOUC prevention on initial load
  • Validate segmented control focus and active states

- Add system theme preference detection as fallback when no saved preference exists
- Implement automatic theme switching when system preference changes
- Apply initial theme before React mount to prevent flash of unstyled content (FOUC)
- Enhance segmented control styling with better focus states and active styling
- Add defensive error handling for localStorage and matchMedia API access
@markwylde markwylde merged commit 5825ee2 into main Aug 9, 2025
3 checks passed
@markwylde markwylde deleted the feat/improve-theme-handling branch August 9, 2025 14:26
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