adds dark mode

This commit is contained in:
Christian Beutel
2024-02-22 01:00:09 +01:00
parent a24662a56e
commit 442e13b7c7
27 changed files with 240 additions and 83 deletions

View 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");
}
}