Open Nautman opened 3 years ago
This should be prioritized, I hate getting a sudden flash when loading a website
I guess the problem is that you can't tell the Html to enable dark-mode using js before the js has loaded. The only possible way to solve it would be to detect and change the native dark/light mode using CSS. Which I did here ☺:
Cool! You can try to open a pull request and see how that works. It's worth noting though that the CSS solution doesn't take into account if you have dark mode browser but light mode setting, or light mode browser but dark mode setting. I'm not entirely sure how we should weigh these alternatives? If it's worth guessing what the user has.
I think one complicated solution would be let a server check if there is a cookie for dark mode, and inject CSS into index.html
.
It would be neat with a dark mode for the initial loading screen. This is to prevent flashes for when the page hasn't loaded yet.