diff --git a/public/js/color-modes.js b/public/js/color-modes.js index b916780..69dd910 100644 --- a/public/js/color-modes.js +++ b/public/js/color-modes.js @@ -20,8 +20,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); }