You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
The background should not flicker blue when reloading the page. Instead it should immediately show the current color mode's background color.
To view the expected behavior, uncomment this line in src/theme.js and reload the page.
Screenshots
In the example repository I have set a transition for the background color to further demonstrate the inital blue background. It is less evident (but still visible) without the transition. To view the flicker without any transition, comment out this line.
Additional context
The workaround that I am using by setting initialColorModeName to one of the color modes seems to be a very odd solution. There is a warning which outputs:
The initialColorModeName value should be a unique name and cannot reference a key in theme.colors.modes.
The docs state that initialColorModeName is used to define the key used for the top-level color palette, so I do not know why this fix works. Furthermore, if I change initialColorModeName to something other than light or dark, the flicker returns. I would appreciate any clarification on why this is happening. Thanks!
The text was updated successfully, but these errors were encountered:
Describe the bug
When reloading a page which is supposed to display the current color mode's background color, a brief blue background is visible.
To Reproduce
Steps to reproduce the behavior:
yarn install
andyarn dev
Expected behavior
The background should not flicker blue when reloading the page. Instead it should immediately show the current color mode's background color.
To view the expected behavior, uncomment this line in
src/theme.js
and reload the page.Screenshots
In the example repository I have set a transition for the background color to further demonstrate the inital blue background. It is less evident (but still visible) without the transition. To view the flicker without any transition, comment out this line.
Blue flicker on reload (Bug):
https://streamable.com/3y85jd
No flicker on reload (Expected behavior):
https://streamable.com/gi0ck9
Additional context
The workaround that I am using by setting
initialColorModeName
to one of the color modes seems to be a very odd solution. There is a warning which outputs:The docs state that
initialColorModeName
is used to define the key used for the top-level color palette, so I do not know why this fix works. Furthermore, if I changeinitialColorModeName
to something other thanlight
ordark
, the flicker returns. I would appreciate any clarification on why this is happening. Thanks!The text was updated successfully, but these errors were encountered: