From fea755b06ffb00b4affadabca358d7aef1981187 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Sat, 23 Dec 2023 15:59:21 +0000 Subject: [PATCH] deploy: d795d4e46da2925b1c554be73eaeb58915076176 --- assets/js/color-modes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/color-modes.js b/assets/js/color-modes.js index 2f7fab98f..36a420b0c 100644 --- a/assets/js/color-modes.js +++ b/assets/js/color-modes.js @@ -18,8 +18,8 @@ } const setTheme = theme => { - if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) { - document.documentElement.setAttribute('data-bs-theme', 'dark') + if (theme === 'auto') { + document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')) } else { document.documentElement.setAttribute('data-bs-theme', theme) }