welpo / tabi

A modern Zola theme with search, multilingual support, optional JavaScript, a perfect Lighthouse score, and a focus on accessibility.

Home Page:https://welpo.github.io/tabi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dark theme flashes on page load/reload

eugenesvk opened this issue · comments

commented

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?

commented

Thanks for reporting this. I'm looking into a fix.

commented

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

commented

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.