Files
GTI_GERENCIADOR_FISCAL/fiscal/central/static/tema.js
T
gti d21a9d1140 Add 'fiscal/' from commit '102ba84500dbd9655a0471288c3e278652593ca9'
git-subtree-dir: fiscal
git-subtree-mainline: d95165fc8f
git-subtree-split: 102ba84500
2026-09-29 14:43:23 -03:00

18 lines
595 B
JavaScript

// app/static/tema.js — alterna e persiste o tema claro/escuro do painel.
(function () {
var botao = document.getElementById("botao-tema");
if (!botao) return;
function temaAtual() {
var salvo = localStorage.getItem("tema");
if (salvo === "claro" || salvo === "escuro") return salvo;
return "escuro"; // padrão do painel sem preferência salva
}
botao.addEventListener("click", function () {
var novo = temaAtual() === "escuro" ? "claro" : "escuro";
document.documentElement.setAttribute("data-tema", novo);
localStorage.setItem("tema", novo);
});
})();