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) }