diff --git a/assets/scripts/features/theme/index.js b/assets/scripts/features/theme/index.js index 52d0282..3d7ae08 100644 --- a/assets/scripts/features/theme/index.js +++ b/assets/scripts/features/theme/index.js @@ -20,8 +20,8 @@ window.addEventListener('load', async () => { function checkScheme(scheme) { - if (THEME_LIGHT == false) return "dark" - if (THEME_DARK == false) return "light" + if (THEME_LIGHT === false) return "dark" + if (THEME_DARK === false) return "light" return scheme } diff --git a/layouts/partials/helpers/get-esbuild-options.html b/layouts/partials/helpers/get-esbuild-options.html index bdc4d32..af9eed9 100644 --- a/layouts/partials/helpers/get-esbuild-options.html +++ b/layouts/partials/helpers/get-esbuild-options.html @@ -69,17 +69,19 @@ params: # id: foo # name: bar - # The `darkMode` feature. It's a deprecated setting but keep backward compatibility - darkmode: + # [Deprecated] The `darkMode` feature + # This is a deprecated setting, but has not been removed to maintain backward compatibility + # If `theme` is set, the `darkMode` setting will be discarded. + darkMode: enable: true - - # Configure theme settings + + # The `theme` feature theme: enable: true services: light: true # enable light theme. default "true" dark: true # enable dark theme. default "true" - defaultTheme: light # can be either light, dark or system. default "system" + default: system # can be either light, dark or system. default "system" This helper will convert the above config into the following env vars: