Skip to content
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

feat: support prefers-color-scheme #15

Closed
josefaidt opened this issue Nov 27, 2020 · 1 comment · Fixed by #23
Closed

feat: support prefers-color-scheme #15

josefaidt opened this issue Nov 27, 2020 · 1 comment · Fixed by #23

Comments

@josefaidt
Copy link
Owner

Support prefers-color-scheme with window.matchMedia() to determine user theme on first visit.

Current Behavior:

on visit, active theme choice is decided by

  1. local storage (if exists)
  2. fallback to first theme in themes array

Proposed Behavior:

on visit, active theme choice is decided by

  1. local storage (if exists)
  2. prefers-color-scheme choice (will be light or dark and themes should have a palette with one of these names)
  3. fallback to first theme in themes array

Changes

  • add new prop to disable proposed behavior, something like disablePrefersColorScheme? Forcing the new behavior may cause unwanted UX adjustments
  • add test to prove new behavior and prop are working as intended
@josefaidt
Copy link
Owner Author

@dysfunc thoughts on the proposed prop to disable the new behavior?

This was referenced Feb 2, 2021
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 a pull request may close this issue.

1 participant