From b6244030a3aaf8faa9654024eb553f61f0b5d8ed Mon Sep 17 00:00:00 2001 From: JY Hsu Date: Sun, 1 Sep 2024 13:52:35 +0800 Subject: [PATCH] fix: Fix default theme value --- assets/scripts/features/theme/index.js | 6 +++--- layouts/_default/baseof.html | 2 +- layouts/index.html | 2 +- layouts/partials/navigators/theme-selector.html | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/assets/scripts/features/theme/index.js b/assets/scripts/features/theme/index.js index fb60421..52d0282 100644 --- a/assets/scripts/features/theme/index.js +++ b/assets/scripts/features/theme/index.js @@ -2,8 +2,8 @@ import * as params from '@params'; const PERSISTENCE_KEY = 'theme-scheme' const themeOptions = params.theme || {} -const THEME_DARK = typeof themeOptions.dark === 'undefined' ? false : themeOptions.dark; -const THEME_LIGHT = typeof themeOptions.light === 'undefined' ? false : themeOptions.light; +const THEME_DARK = typeof themeOptions.dark === 'undefined' ? true : themeOptions.dark; +const THEME_LIGHT = typeof themeOptions.light === 'undefined' ? true : themeOptions.light; const THEME_DEFAULT = typeof themeOptions.default === 'undefined' ? "system" : themeOptions.default; window.addEventListener('load', async () => { @@ -55,7 +55,7 @@ window.addEventListener('load', async () => { // save preference to local storage saveScheme(newScheme) - + setImages(theme) } diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 0bc76f7..dc1850a 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -12,7 +12,7 @@ {{- partial "analytics.html" . -}}