Spaces:
Runtime error
Runtime error
Download src/lib/switchTheme.ts from BetterAPI/BetterChat: direct link, hf CLI and curl.
- Browser
- Download file 268 Bytes
-
https://huggingface.co/spaces/BetterAPI/BetterChat/resolve/2dc7d8d3e6f756f3fcf4e68582f84d7e7efab73c/src/lib/switchTheme.ts
- Command line
-
hf download hf://spaces/BetterAPI/BetterChat@2dc7d8d3e6f756f3fcf4e68582f84d7e7efab73c/src/lib/switchTheme.ts
-
curl -L -o switchTheme.ts https://huggingface.co/spaces/BetterAPI/BetterChat/resolve/2dc7d8d3e6f756f3fcf4e68582f84d7e7efab73c/src/lib/switchTheme.ts
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"; | |
| } | |
| } | |