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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid flash of default theme #157

Open
krowter opened this issue Jan 21, 2024 · 0 comments
Open

Avoid flash of default theme #157

krowter opened this issue Jan 21, 2024 · 0 comments
Labels
difficulty: easy enhancement New feature or request help wanted Extra attention is needed

Comments

@krowter
Copy link
Contributor

krowter commented Jan 21, 2024

Currently, user will see light mode for a split second before the dark mode applies on page reload/visit. The reason is there’s a pause after user visits the page until the dark mode script runs.

There’s probably an off-the-shelf library that takes care of the flash like next-themes. Or since we already have the logic for setting dark mode, the final stretch is to move it to a <script> tag before the <body> as outlined in https://hangindev.com/blog/avoid-flash-of-default-theme-an-implementation-of-dark-mode-in-react-app

@aldy505 aldy505 added enhancement New feature or request help wanted Extra attention is needed difficulty: easy labels Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants