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'
|
||||
|
||||
// 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"))
|
||||
---
|
||||
|
||||
<head>
|
||||
|
|
|
@ -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'
|
||||
|
|
Reference in a new issue