From 081c2bffb329182d92cf0534dd42b11826a87c39 Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 28 Jan 2026 01:06:31 +0100
Subject: feat: more theme work

---
 src/routes/blog/+layout.svelte | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

(limited to 'src/routes/blog/+layout.svelte')

diff --git a/src/routes/blog/+layout.svelte b/src/routes/blog/+layout.svelte
index 61ab5f3..073d5c3 100644
--- a/src/routes/blog/+layout.svelte
+++ b/src/routes/blog/+layout.svelte
@@ -1,27 +1,14 @@
 <script lang="ts">
-  import { blogStorage } from '$/lib/storage';
-  import { page } from '$app/state';
-  import { onDestroy, onMount, type Snippet } from 'svelte';
+  import theme from '$/lib/theme.svelte';
+  import { type Snippet } from 'svelte';
+
+  theme.themeCompatible();
 
   const {
     children,
   }: {
     children: Snippet;
   } = $props();
-
-  onMount(() => {
-    const theme =
-      page.url.searchParams.get('theme') ?? blogStorage.getItem('theme');
-    if (theme) {
-      blogStorage.setItem('theme', theme);
-      document.documentElement.setAttribute('data-blog-theme', theme);
-      page.url.searchParams.delete('theme');
-    }
-  });
-  onDestroy(() => {
-    if (typeof document !== 'undefined')
-      document.documentElement.removeAttribute('data-blog-theme');
-  });
 </script>
 
 {@render children()}
-- 
cgit v1.2.3

