From 07ca080032250f0f90cdc1db50cb11fb9d96d5ff Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Thu, 9 May 2024 10:34:40 +0200 Subject: [PATCH] Use snippets for the icons --- src/lib/components/ThemePicker.svelte | 37 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/src/lib/components/ThemePicker.svelte b/src/lib/components/ThemePicker.svelte index 6287fdc..0aefcfb 100644 --- a/src/lib/components/ThemePicker.svelte +++ b/src/lib/components/ThemePicker.svelte @@ -20,7 +20,6 @@ } } - // let icon = $derived.by(() => theme) let icon = $derived(theme) @@ -34,9 +33,9 @@ {#if icon === "dark"} - {@html ``} + {@render DarkModeIcon()} {:else} - {@html ``} + {@render LightModeIcon()} {/if} @@ -44,6 +43,38 @@ {/key} +{#snippet DarkModeIcon()} + + +{/snippet} + +{#snippet LightModeIcon()} + + + +{/snippet} +