From 05511d74005846550d93b52498cd9d6ac384a962 Mon Sep 17 00:00:00 2001 From: Korbs Date: Fri, 25 Oct 2024 14:53:27 -0400 Subject: [PATCH] Add theme toggle with cookies --- source/src/components/global/Head.astro | 26 ++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/source/src/components/global/Head.astro b/source/src/components/global/Head.astro index b8b8403..790d821 100644 --- a/source/src/components/global/Head.astro +++ b/source/src/components/global/Head.astro @@ -1,6 +1,13 @@ --- // Components import { Tooltips } from 'astro-tooltips' + +// User Configuration +if (Astro.cookies.get("Theme").value === "Light") { + var ThemeScheme = 'light' +} else if (Astro.cookies.get("Theme").value === "Dark") { + var ThemeScheme = 'dark' +} --- @@ -15,6 +22,23 @@ import { Tooltips } from 'astro-tooltips' + + - \ No newline at end of file + + + + \ No newline at end of file