We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d769ae0 commit 73e1dcfCopy full SHA for 73e1dcf
site/static/docs/5.3/assets/js/color-modes.js
@@ -20,8 +20,8 @@
20
}
21
22
const setTheme = theme => {
23
- if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) {
24
- 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'))
25
} else {
26
document.documentElement.setAttribute('data-bs-theme', theme)
27
0 commit comments