Skip to content

fix: fallback to user prefered mode instead of assuming dark mode for first-time theme load #651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2025

Conversation

ZibanPirate
Copy link
Member

@ZibanPirate ZibanPirate commented Apr 12, 2025

The bug:

clear the cookie and load the website on a system that has light theme preferred

Expected:
you should get light mode

Actual:
you get dark mode

Fix:

when loading the theme from cookie, if no theme is found, try detecting user-prefered theme, and then fallback to dark mode

NOTE

also changed the code a bit, to allow for non-binary options, like having a thrid auto-detect option, or other theme names

  • Bug fix
  • New feature
  • Other

@github-actions github-actions bot added fix web Web related changes ( web folder ) labels Apr 12, 2025
@ZibanPirate ZibanPirate requested a review from a team April 12, 2025 10:49
@ZibanPirate ZibanPirate marked this pull request as ready for review April 12, 2025 10:49
@ZibanPirate ZibanPirate enabled auto-merge April 12, 2025 10:51
@ZibanPirate ZibanPirate merged commit 6af62bc into main Apr 12, 2025
30 checks passed
@ZibanPirate ZibanPirate deleted the fix/fallback-to-user-pref-insteadof-dark-mode branch April 12, 2025 10:54
@github-project-automation github-project-automation bot moved this to Merged in DzCode i/o Apr 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix web Web related changes ( web folder )
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

2 participants