Files
msgs/web/js/theme.js
T
wt b833266664
Continuous integration / Check (push) Successful in 35s
Continuous integration / Rustfmt (push) Successful in 31s
Continuous integration / build (push) Successful in 30s
Continuous integration / build-release (push) Successful in 51s
more refactor in frontend javascript
2025-11-28 02:28:52 +07:00

11 lines
333 B
JavaScript

let currentTheme = localStorage.getItem("theme") || "light";
// Initialize theme
document.body.setAttribute("data-theme", currentTheme);
function toggleTheme() {
currentTheme = currentTheme === "light" ? "dark" : "light";
document.body.setAttribute("data-theme", currentTheme);
localStorage.setItem("theme", currentTheme);
}