mirror of
https://github.com/TrezOne/congo-hindi-gujarati.git
synced 2026-07-20 09:51:37 -04:00
✨ Allow appearance switcher to be placed in menus
This commit is contained in:
@@ -39,8 +39,8 @@ if (document.documentElement.getAttribute("data-auto-appearance") === "true") {
|
||||
}
|
||||
|
||||
window.addEventListener("DOMContentLoaded", (event) => {
|
||||
const switcher = document.getElementById("appearance-switcher");
|
||||
if (switcher) {
|
||||
var switchers = document.querySelectorAll("[id^='appearance-switcher']");
|
||||
switchers.forEach((switcher) => {
|
||||
switcher.addEventListener("click", () => {
|
||||
document.documentElement.classList.toggle("dark");
|
||||
setThemeColor();
|
||||
@@ -53,5 +53,5 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||
event.preventDefault();
|
||||
localStorage.removeItem("appearance");
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user