// Applies the theme before the first paint: . // An external file because the CSP allows no inline scripts. The choice // lives in localStorage; without one the device's setting decides. (function () { var t = null; try { t = localStorage.getItem("visa-theme"); } catch (e) { /* storage blocked */ } if (t !== "light" && t !== "dark") { t = window.matchMedia && window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark"; } document.documentElement.setAttribute("data-theme", t); })();