From 5955f45a304595ee2e4354b332c73f0721af353e Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 8 Apr 2020 00:42:06 -0600 Subject: [PATCH] Improve the theme detection logic --- templates/partial/flex.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/partial/flex.html b/templates/partial/flex.html index 8843889..3a963a1 100644 --- a/templates/partial/flex.html +++ b/templates/partial/flex.html @@ -16,8 +16,8 @@ const darkSchemeWatch = window.matchMedia('(prefers-color-scheme: dark)'); function detectThemeAndSwitchStyle() { - let theme = localStorage.getItem('themeOverride') || 'browser'; - if (theme === 'browser') { + let theme = localStorage.getItem('themeOverride'); + if (theme !== 'light' && theme !== 'dark') { theme = darkSchemeWatch.matches ? 'dark' : 'light'; } console.log(`Switching theme to ${theme}.`)