Make sure default theme is set for the end-user
This commit is contained in:
parent
fdc04643bb
commit
69f192cc36
2 changed files with 7 additions and 4 deletions
|
@ -3,13 +3,14 @@
|
||||||
import { Tooltips } from 'astro-tooltips'
|
import { Tooltips } from 'astro-tooltips'
|
||||||
|
|
||||||
// User Configuration
|
// 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'
|
var ThemeScheme = 'light'
|
||||||
} else if (Astro.cookies.get("Theme").value === "Dark") {
|
} else if (Astro.cookies.get("Theme").value === "Dark") {
|
||||||
var ThemeScheme = 'dark'
|
var ThemeScheme = 'dark'
|
||||||
}else if (Astro.cookies.get("Theme").value === undefined) {
|
|
||||||
var ThemeScheme = 'dark'
|
|
||||||
}
|
}
|
||||||
|
console.log(Astro.cookies.get("Theme"))
|
||||||
---
|
---
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
|
|
@ -12,7 +12,9 @@ import '@styles/index.scss'
|
||||||
import '@styles/mobile.scss'
|
import '@styles/mobile.scss'
|
||||||
|
|
||||||
// User Configuration
|
// 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'
|
var ThemeScheme = 'light'
|
||||||
} else if (Astro.cookies.get("Theme").value === "Dark") {
|
} else if (Astro.cookies.get("Theme").value === "Dark") {
|
||||||
var ThemeScheme = 'dark'
|
var ThemeScheme = 'dark'
|
||||||
|
|
Loading…
Reference in a new issue