chat-ui-3.0 / src /lib /switchTheme.ts
Toaster496's picture
Duplicate from huggingchat/chat-ui
3ea9478
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";
}
}