Skip to content
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

Open
bravo-is opened this issue Jun 12, 2024 · 2 comments
Open

馃挕 Idea #8497

bravo-is opened this issue Jun 12, 2024 · 2 comments
Assignees
Labels
help - confirm behaviour Walk through the example/issue and confirm this is a general behaviour, or a correct update to make. site improvement Some thing that improves the website functionality - ask @delucis for help!

Comments

@bravo-is
Copy link

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>

@sarah11918
Copy link
Member

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!

@sarah11918 sarah11918 added site improvement Some thing that improves the website functionality - ask @delucis for help! help - confirm behaviour Walk through the example/issue and confirm this is a general behaviour, or a correct update to make. labels Jun 15, 2024
@bravo-is
Copy link
Author

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 馃槃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help - confirm behaviour Walk through the example/issue and confirm this is a general behaviour, or a correct update to make. site improvement Some thing that improves the website functionality - ask @delucis for help!
Projects
None yet
Development

No branches or pull requests

3 participants