DEV Community

Discussion on: Toggle 🌒 dark and 🔆 sunny mode using AlpineJS, and TailwindCSS

Collapse
 
guozian profile image
guozian

Hi, just found your post, and it's very useful. I have followed your tutorial and implemented in my website. However, I have one issue, if I am in dark mode, every time I refresh the page, it will first show the default light mode for 0.5 second and then quickly switch to the dark mode automatically. I can notice that 0.5 second flash, which is annoying. This is my website edutive.com.au/, can you help me have a look and maybe can help me find out what's the reason? many thanks :)

Collapse
 
elefint profile image
elefint

Might be a bit late but I found this guide very helpful:
css-tricks.com/a-complete-guide-to...

Collapse
 
guozian profile image
guozian

Hey, thank you so much. This guide is so great. I am not professional so will have to read it carefully, hopefully I can understand it and implement to my website, thanks!

Thread Thread
 
elefint profile image
elefint

No problem, a quick band aid I had used before knowing the server side stuff was to add a page loader then the user doesn't see the flicker to dark mode.