Dark theme flashes on page load/reload
eugenesvk opened this issue · comments
If I manually select the dark theme, I notice that sometimes on page reopen or reload the page flashes - it shows the dark theme for a brief moment and then switches back to black
Is there a way to avoid it?
Thanks for reporting this. I'm looking into a fix.
From some limited testing I think abridge theme doesn't suffer from this (ssiyad's boring theme also flashes), might be worth looking into how it achieves that
It should be fixed now. I had to split the JavaScript logic in two files: one to set the theme (loaded in header), and one with the logic to switch the theme (deferred loading).
Inspiration for the fix: codeandmedia/zola_docsascode_theme@9485c9e
Thanks again for the report.