feat: Dark mode #15

Merged
aniva merged 15 commits from styling/dark-mode into main 2024-10-15 19:32:16 -07:00
1 changed files with 2 additions and 1 deletions
Showing only changes of commit 571d54a975 - Show all commits

View File

@ -1,6 +1,6 @@
<script lang="ts"> <script lang="ts">
import { Moon, Sun } from 'lucide-svelte'; import { Moon, Sun } from 'lucide-svelte';
import { theme } from '$lib/theme' import { theme, setTheme } from '$lib/theme'
function toggleTheme() { function toggleTheme() {
theme.update((currentTheme) => { theme.update((currentTheme) => {
@ -14,6 +14,7 @@
} else { } else {
document.documentElement.classList.add('dark'); document.documentElement.classList.add('dark');
} }
setTheme(newTheme);
return newTheme return newTheme
}) })
} }