System preference doesn't work by default
See original GitHub issueWhen I read the docs it looks like system preference is set to true by default.
enableSystem = true
: Whether to switch between dark and light based on prefers-color-scheme
But when I implement this or just browse the demo https://next-themes-example.vercel.app/ or the one with Tailwind — even though my macOS preference is set to dark
, the theme gets set to light
.
This doesn’t look like a sane default or a bug. My thought process is that next-themes would by default prefer the system’s preference when available and only fallback to light if it’s not.
Am I doing something wrong?
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Here's what to do if System Settings is not responding - MacPaw
Press Command + Option + Escape, choose System Settings in the window, and press Force Quit. 2. Restart your Mac in safe mode....
Read more >Fix System Preferences Not Responding & Preferences Errors
Press Command + Space bar to bring up Spotlight search, then type in System Preferences. Open System Preferences from Finder > Applications > ......
Read more >Default browser setting not working - Apple Community
Do NOT go to System Preferences instead Open Safari and go to Safari Preferences, the first drop down should offer the choice of...
Read more >Why won't the system preferences on my Mac open? How can ...
By Pressing CMD and Space, typing in 'System Preferences', and pressing enter. OR by pressing CTRL, FN and F3, then using the left...
Read more >Why cannot I see any browsers in system preferences?
That's what worked for me. Try setting Safari as the default browser in Safari prefs (General Tab). Restart your machine then go back...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I published
0.0.13-beta.1
with the following changes:system
is now the default theme isenableSystem === true
, otherwise it’s stilllight
localStorage
on first load, only when you switch themeThese should resolve this issue. Please test, and let me know if you have any feedback.
Thanks for the response. I did read through the issue. It seems like a bad default. The main purpose of this library is to be able to adopt to the user preference since it doesn’t provide a UI (for setTheme which is a feature and is opt-in). Please consider making the
system
setting default.My setup did start working I have no idea how. Bunch of cache removals and then setting themese manually etc — and now it works with:
But when I set
Post.theme =
light;
— that page theme doesn’t change to thelight
theme.If console log the the theme being forced
Then it logs
Component.theme light
. This is not working because of the same caching issue?