-
Notifications
You must be signed in to change notification settings - Fork 671
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
Default useColorSchemeMediaQuery to true #624
Comments
Totally agree with this. Since you have to manually add a color switcher to your site, it makes Theme UI seem broken that adding a dark mode to the theme & enabling your system dark mode doesn’t enable it. |
My original gut instinct on this was that many users wouldn't necessarily expect the system-level dark mode to affect a website, but if the developer opts into the behavior, it's potentially less surprising. That said, most of these APIs are new and I don't know what best practices are going to emerge for things like this so maybe enabled by default makes more sense. A somewhat related issue to this is that if you have the flag enabled, the dark/light mode cannot be controlled solely by the media query because the mode that it initializes as is stored in localStorage and then that takes precedence over the media query. I think if we do enable the media query initialization by default, that issue should be resolved as well -- i.e. only store a color mode if the |
Started using theme-ui a while ago and so far I'm loving it. Cool work 🙏🏼 But today I ran into this issue which was mentioned here as a side note by @jxnblk. I enabled Meaning if my OS is in dark mode and I load the site it should initially render with its dark color mode. And respectively it should render with its light color mode if the OS in light mode. If I understood it correctly the way theme-ui works at the moment is that once a color mode is determined, for example via I'm not aware about the conventions regarding this rather new topic either. Here are couple of thoughts and oddities that I can't find good answers to and that might influence how the local storage and color mode detection logic might be implemented in theme-ui.
Would be very curious about opinions and would also love to help out if something can be improved here with a PR. |
I seems like the default use case/expected behavior when having a
dark
& alight
theme would be to match the darkmode media query. Could we defaultuseColorSchemeMediaQuery
to true to avoid folks having to dig through the docs to figure out whether that's the way it works or not?The text was updated successfully, but these errors were encountered: