Something went wrong. Try again.
Mirror of https://github.com/kualta/site — web infrastructure
Something went wrong. Try again.
705 B · 20 lines
Astro
at feed-path
123456789101112131415161718192021<script is:inline> (function () { function apply(root) { let dark = true; try { const stored = localStorage.getItem("theme"); if (stored) dark = stored === "dark"; } catch (_) {} root.classList.toggle("dark", dark); } apply(document.documentElement); // The router copies each new page's <html> class, which is rendered dark, // so the stored choice has to reach the incoming page before it is swapped in. if (window.__themeFollowsNavigation) return; window.__themeFollowsNavigation = true; document.addEventListener("astro:before-swap", function (event) { apply(event.newDocument.documentElement); }); })();</script>