document.querySelectorAll(".theme-switcher [data-theme-choice]").forEach(function (button) { button.addEventListener("click", function () { window.setEvectionTheme(button.dataset.themeChoice === "system" ? null : button.dataset.themeChoice); markActiveThemeButton(); }); }); function markActiveThemeButton() { var current = null; try { current = localStorage.getItem("evection-theme"); } catch (e) { /* ignore */ } document.querySelectorAll(".theme-switcher [data-theme-choice]").forEach(function (button) { var isActive = button.dataset.themeChoice === (current || "system"); button.classList.toggle("active", isActive); }); } markActiveThemeButton();