Skip to content

Commit 73e1dcf

Browse files
MewenLeHomdo
authored andcommitted
Fix color-mode.js
1 parent d769ae0 commit 73e1dcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

site/static/docs/5.3/assets/js/color-modes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
}
2121

2222
const setTheme = theme => {
23-
if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
24-
document.documentElement.setAttribute('data-bs-theme', 'dark')
23+
if (theme === 'auto') {
24+
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'))
2525
} else {
2626
document.documentElement.setAttribute('data-bs-theme', theme)
2727
}

0 commit comments

Comments
 (0)