INNER CODE UNIT · JavaScript
currentTheme
jatinkrmalik/LLMFeeder · web/main.js:18
const currentTheme = () =>
doc.getAttribute("data-theme") === "dark" ? "dark" : "light";
function applyTheme(theme) {
const next = theme === "dark" ? "dark" : "light";
doc.setAttribute("data-theme", next);
try {
localStorage.setItem("llmfeeder-theme", next);
} catch (_) {
/* private mode: in-memory only */
}
if (themeToggle) {
themeToggle.setAttribute(
"aria-label",
next === "dark" ? "Switch to light theme" : "Switch to dark theme"
);
}
}