adisaktijrs / hexo-theme-minima

A lightweight dark/light theme for Hexo.js
https://adisaktijrs.github.io/minima
MIT License
220 stars 51 forks source link

Dark theme still flashes #8

Closed yukimuon closed 3 years ago

yukimuon commented 3 years ago

Hi, as the fix update on function setDarkMode(), there is still a small chance for redirect to flash to white page. I tried pduchnovsky's solution on his website to auto switch, but it still has a much smaller change to flash! My guess is the loading time of the dark.css and js exec time. My solution is like pduchnovsky's, but put default color to be dark then switch to light, also put the style to custom.css. As he already put up a pr I will wait for this to be reviewed and merged, also ask browser to cache custom.css in local. My variance is in my forked branch, with my website If you would like me to put up this, just reply under this issue😛

adisaktijrs commented 3 years ago

Hi @yukimuon, I still wondering about this 'flashes' issue as well. I just merged the latest @pduchnovsky PR but haven't test it yet at the demo website. I will take a look comprehensively ASAP. Yet if you already tested it, I believe it would be great to try your solution. Thank you.

yukimuon commented 3 years ago

I just tested the merge#7, works good so far with no flashing anymore.