chat-uigl / src /lib /switchTheme.ts
DakMak's picture
Duplicate from coyotte508/chat-ui
ece0c29
raw
history blame contribute delete
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";
}
}