-
Notifications
You must be signed in to change notification settings - Fork 673
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
initialColorMode in gatsby-plugin-theme-ui not working #367
Comments
I've been reading the source code of theme-ui and seems that it looks for the I think it would be great if you could ignore what values is |
The plan is to make the media query behavior optional, which we'll probably prioritize sooner with dark mode coming to iOS and Android now |
On my end it is not working at all, I have this color configuration: export default {
initialColorMode: 'light',
colors: {
primary: '#00ccd7',
background: '#fff',
text: '#4f4f4f',
accent: '#333',
muted: '#a8a8a8',
modes: {
dark: {
background: '#000',
text: '#fff',
},
},
},
} And the MacOS settings defined to use Dark Mode, but still can't get it to work automatically. |
@iamkevinwolf as of the latest version, if you want to initialize color mode based on the |
Thanks @jxnblk, adding that to my theme solved the issue. Although I have a recommendation: the theme should always be in sync with the system preferences, this is what just happened to me:
Is this an expected behaviour? IMHO it should change according to the system preferences, and only save into localStorage if the user explicitly set so. |
I agree with the comment by @iamkevinwolf. My preferred behaviour would be localStorage would never be set until and unless |
Closing this since the behavior will be changing slightly in v0.3 -- see #535 |
When using the
gatsby-plugin-theme-ui
plugin with Gatsby, it is not using theinitialColorMode
in the/src/gatsby-plugin-theme-ui/index.js
file, and instead, it is using thedark
mode directly.Take this theme as an example:
It should use the light mode as the default mode, but instead, it is using the
dark
mode with no reason.Here is a reproduction of the issue: https://codesandbox.io/embed/gatsby-starter-default-qyqkp
The text was updated successfully, but these errors were encountered: