mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-21 03:41:03 +00:00
Fix color-mode.js
This commit is contained in:
parent
d769ae0e0f
commit
73e1dcf43e
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user