Hacker Newsnew | past | comments | ask | show | jobs | submit | ucffool's commentslogin

Holy s*t loaded question batman


I like the idea that dark mode is the default before load so that there isn't a white-screen flash. Stealing it!


If it was backend-powered I could check a cookie, but the site is static. Since I made it dark-mode-first, I think it's a good compromise. Looking for other ideas too


We'll you could use the HTML element for the class. The other day I did an example for a client this way: <html class="default"> <head> <script> if( localStorage.getItem('dark-mode') !== null ) { document.documentElement.classList.add('dark-mode'); } </script>


Well I'm doing a PWA with LIGHT as default theme, but a dark-to-light flash doesn't bother anyone who wants light, but a light-to-dark flash means a lot to someone who prefers dark.


Formlabs also now being labeled as a unicorn hasn't helped matter.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: