-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
The page first loads with the initialColorMode set (default = 'light') #5145
Comments
Hi @lil-newty, This sounds interesting. I think @takethefake can give a better perspective to this.
It'll help to see a reproduction of this as well. |
I believe this is a duplicate of #5046. While 5046 talks about Thanks for the detailed write-up. I will close this in favor of the earlier issue. |
@segunadebayo yeah, I meant this exact flash! @primos63 , thank you for tackling this issue! The demonstration about the 2nd change proposal: steps: const config: ThemeConfig = {
initialColorMode: 'light',
useSystemColorMode: true,
}; -open the application in a clean storage (in this case private window) expected: |
Yes, that is the way The comments in the code detail the settings. |
@primos63 my bad, thank you! |
Description
When the browser loads an UI written with Chakra there is a first load with the initialColorMode set, and then it switches to the system/chosen by user color.
Problem Statement/Justification
1- I believe it should be expected to load right away with the system color or the one chosen by the user. Some sites that work first loading the system color mode include: github.com, facebook.com, google.com
2- I think it makes more sense the preferred color stored in storage should override the system color after the first access, but it is not possible with the current api, you either have the theming along with the system or along with the stored value, we can't have the system only in the first access by default. These same websites work this way.
I think it'd be a great change to Chakra because the majority of the most accessed sites work this way.
Proposed Solution or API
I've read through the code but I am not confident enough to make changes just yet, but I suppose if the storage was accessed before the initialColorMode is set, and setting it in advance, it should solve the 1st problem.
Thanks for reading this proposal until here! 🚀
Alternatives
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: