blind_chat / src /lib /switchTheme.ts
lauro1's picture
test
faca43f
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";
}
}