site/public/theme.js
6 lines and 0 functions in DrDustinEdwards/capsomer, at commit d44446f on 2026-10-25. This file on GitHub.
Functions
None: it only declares types or values.
Imports
It imports no other module of this repo. No module of this repo imports it.
Source
// The theme the visitor chose, set before the page paints (the site's CSP allows no inline script).
// The key is the theme switch's own (components/theme-switch, THEME_PREF).
try {
const t = localStorage.getItem("cap-theme");
if (t === "light" || t === "dark") document.documentElement.dataset.theme = t;
} catch {}