-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃挕 Idea #8497
Comments
Hi @bravo-is - I'm not able to replicate any theme flicker based on what you've said above. Can you describe more, or maybe show a screenshot of exactly what steps produce the flicker? Would also be happy to hear steps to reproduce if anyone else notices this! |
Hi @sarah11918 , to reproduce this I just needed to use all of the suggested code in the Update scripts section. With the dev server running I switch the theme to dark mode. Now whenever I refresh the browser (F5) I see the light theme flicker before the dark theme is applied (Firefox and Edge). Thanks for looking into this 馃槃 |
I didn't run into any flicker while navigating between routes. But the theme does flicker if the browser is refreshed. To fix this you can just add this inline script, instead of the suggested after-swap event
<script is:inline> localStorage.theme === 'dark' ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark"); </script>
The text was updated successfully, but these errors were encountered: