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/0592f207c0819df96caa4eb96d1dd79bee3392ad/src/lib/switchTheme.ts
- Command line
-
hf download hf://spaces/BetterAPI/BetterChat@0592f207c0819df96caa4eb96d1dd79bee3392ad/src/lib/switchTheme.ts
-
curl -L -o switchTheme.ts https://huggingface.co/spaces/BetterAPI/BetterChat/resolve/0592f207c0819df96caa4eb96d1dd79bee3392ad/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"; | |
| } | |
| } | |