diff --git a/source/src/components/global/Head.astro b/source/src/components/global/Head.astro index 70a3c94..89f5d9a 100644 --- a/source/src/components/global/Head.astro +++ b/source/src/components/global/Head.astro @@ -3,13 +3,14 @@ import { Tooltips } from 'astro-tooltips' // User Configuration -if (Astro.cookies.get("Theme").value === "Light") { +if (Astro.cookies.get("Theme") === undefined) { + Astro.cookies.set("Theme", "Dark") +} else if (Astro.cookies.get("Theme").value === "Light") { var ThemeScheme = 'light' } else if (Astro.cookies.get("Theme").value === "Dark") { var ThemeScheme = 'dark' -}else if (Astro.cookies.get("Theme").value === undefined) { - var ThemeScheme = 'dark' } +console.log(Astro.cookies.get("Theme")) --- diff --git a/source/src/layouts/Base.astro b/source/src/layouts/Base.astro index 349fbcd..2401314 100644 --- a/source/src/layouts/Base.astro +++ b/source/src/layouts/Base.astro @@ -12,7 +12,9 @@ import '@styles/index.scss' import '@styles/mobile.scss' // User Configuration -if (Astro.cookies.get("Theme").value === "Light") { +if (Astro.cookies.get("Theme") === undefined) { + Astro.cookies.set("Theme", "Dark") +} else if (Astro.cookies.get("Theme").value === "Light") { var ThemeScheme = 'light' } else if (Astro.cookies.get("Theme").value === "Dark") { var ThemeScheme = 'dark'