From b84a4ee4de84fdddda246afe3daa229b13eec414 Mon Sep 17 00:00:00 2001
From: memdmp <memdmp@estrogen.zone>
Date: Wed, 14 Jan 2026 14:40:20 +0100
Subject: todo: themes

---
 src/routes/blog/+layout.svelte | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 src/routes/blog/+layout.svelte

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

diff --git a/src/routes/blog/+layout.svelte b/src/routes/blog/+layout.svelte
new file mode 100644
index 0000000..1006fdd
--- /dev/null
+++ b/src/routes/blog/+layout.svelte
@@ -0,0 +1,26 @@
+<script lang="ts">
+  import { page } from '$app/state';
+  import { onDestroy, onMount, type Snippet } from 'svelte';
+
+  const {
+    children,
+  }: {
+    children: Snippet;
+  } = $props();
+
+  onMount(() => {
+    const theme =
+      page.url.searchParams.get('theme') ??
+      localStorage.getItem('mem.estrogen.zone:blog:theme');
+    if (theme) {
+      localStorage.setItem('mem.estrogen.zone:blog:theme', theme);
+      document.documentElement.setAttribute('data-blog-theme', theme);
+    }
+  });
+  onDestroy(() => {
+    if (typeof document !== 'undefined')
+      document.documentElement.removeAttribute('data-blog-theme');
+  });
+</script>
+
+{@render children()}
-- 
cgit v1.2.3

