From c1525cd2f29f0c93c9e2fcf575a74836bf1ed227 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Sun, 17 May 2026 17:34:35 +0200 Subject: [PATCH] Add auto fallbacks --- src/features/colorTheme/composables/useColorTheme.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/features/colorTheme/composables/useColorTheme.js b/src/features/colorTheme/composables/useColorTheme.js index eef2519..e9a9853 100644 --- a/src/features/colorTheme/composables/useColorTheme.js +++ b/src/features/colorTheme/composables/useColorTheme.js @@ -16,17 +16,17 @@ limitations under the License. export const useColorTheme = function () { const getColorTheme = function () { - let colorTheme = localStorage.getItem('theme') || 'light'; - if (!(colorTheme === 'dark' || colorTheme === 'light')) { - colorTheme = 'light'; + let colorTheme = localStorage.getItem('theme') || 'auto'; + if (!(colorTheme === 'dark' || colorTheme === 'light' || colorTheme === 'auto')) { + colorTheme = 'auto'; }; return colorTheme; }; const updateColorTheme = function (newTheme) { let actualNewTheme = newTheme; - if (!(actualNewTheme === 'light' || actualNewTheme === 'dark')) { - actualNewTheme = 'light'; + if (!(actualNewTheme === 'dark' || actualNewTheme === 'light' || actualNewTheme === 'auto')) { + actualNewTheme = 'auto'; }; localStorage.setItem('theme', actualNewTheme);