adds dark mode
This commit is contained in:
14
web/src/lib/stores/theme_store.ts
Normal file
14
web/src/lib/stores/theme_store.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { get, writable, type Writable } from "svelte/store";
|
||||
|
||||
type Theme = "dark" | "light"
|
||||
|
||||
export const theme: Writable<Theme> = writable("light");
|
||||
|
||||
|
||||
export function toggleTheme() {
|
||||
if (get(theme) === "light") {
|
||||
theme.set("dark")
|
||||
} else {
|
||||
theme.set("light");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user