fix: use text state

This commit is contained in:
2026-02-05 23:06:39 +05:00
parent 1b8a035708
commit 60b577b6df
7 changed files with 31 additions and 15 deletions
+7
View File
@@ -1,11 +1,18 @@
<script lang="ts">
import AppHeader from "$components/layout/AppHeader.svelte";
import { themeState } from "$states/theme.svelte";
import type { Snippet } from "svelte";
interface Props {
children: Snippet;
}
$effect(() => {
const newTheme = themeState.theme;
document.documentElement.setAttribute("data-theme", newTheme);
localStorage.setItem("theme", newTheme);
});
let { children }: Props = $props();
</script>