chat-aww / src /lib /switchTheme.ts
Adrien Denat
add mobile menu (#64)
4dae10f unverified
raw
history blame
268 Bytes
export function switchTheme() {
const { classList } = document.querySelector("html") as HTMLElement;
if (classList.contains("dark")) {
classList.remove("dark");
localStorage.theme = "light";
} else {
classList.add("dark");
localStorage.theme = "dark";
}
}