This is a mirror from the GitHub repo.
github.com/STBoyden/game-site
1<script lang="ts">
2 import { mode, setMode } from "mode-watcher";
3 import { Moon, Sun } from "@lucide/svelte";
4
5 let checked = $state(mode.current === "dark");
6
7 function updateMode(checked: boolean) {
8 setMode(checked ? "dark" : "light");
9 }
10</script>
11
12<label class="toggle text-base-content">
13 <input
14 type="checkbox"
15 bind:checked={() => checked, updateMode}
16 value="dark"
17 class="theme-controller" />
18 <Sun class="w-[1em] h-[1em]" />
19 <Moon class="w-[1em] h-[1em]" />
20</label>