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

Minor inconvenience: don't show white flash when reloading page in dark mode #2787

Open
Glup3 opened this issue Jun 18, 2024 · 0 comments
Open

Comments

@Glup3
Copy link

Glup3 commented Jun 18, 2024

Describe the feature or enhancement

Hey!

Love the work you do and just wanted to mention a minor inconvenience I face. I have dark mode enabled and I usually like to full refresh the page, but then I am greeted by a white flash, because the useTheme hook hasn't loaded the dark mode yet. I had a quick glance at the code and saw it's being loaded by the useEffect.

Maybe we can implement a solution like https://github.com/pacocoursey/next-themes or just straight up use it for theming.
If I find the time, maybe I can fix it myself and create a PR.

How to reproduce:

  1. enable dark mode
  2. go to any page (dashboard for example)
  3. refresh the page
  4. white flicker at the beginning before it's loading all the components

MacOS 14.4.1 + Brave Browser

PS: I guess I will start using light mode.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant