Browse Source

brand.js: sync shared toggle with legacy body otb-dark class

main
def670 1 month ago
parent
commit
1b6e6b9d9a
  1. 7
      brand.js

7
brand.js

@ -1,6 +1,13 @@
(function () { (function () {
function applyTheme(theme) { function applyTheme(theme) {
document.documentElement.setAttribute("data-theme", theme); document.documentElement.setAttribute("data-theme", theme);
if (theme === "dark") {
document.body.classList.add("otb-dark");
} else {
document.body.classList.remove("otb-dark");
}
const toggle = document.getElementById("otbThemeToggle"); const toggle = document.getElementById("otbThemeToggle");
if (toggle) toggle.checked = theme === "light"; if (toggle) toggle.checked = theme === "light";
} }

Loading…
Cancel
Save