feat: sistema de design (tokens claro/escuro) + sidebar responsiva em base.html

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Gustavo
2026-08-13 21:53:30 -03:00
co-authored by Claude Sonnet 5
parent 7656f2261e
commit 310f5e1f71
4 changed files with 366 additions and 38 deletions
+17
View File
@@ -0,0 +1,17 @@
// 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 window.matchMedia("(prefers-color-scheme: dark)").matches ? "escuro" : "claro";
}
botao.addEventListener("click", function () {
var novo = temaAtual() === "escuro" ? "claro" : "escuro";
document.documentElement.setAttribute("data-tema", novo);
localStorage.setItem("tema", novo);
});
})();