aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/site/static/docs/5.3/assets/js/color-modes.js
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twbs/bootstrap/site/static/docs/5.3/assets/js/color-modes.js')
-rw-r--r--vendor/twbs/bootstrap/site/static/docs/5.3/assets/js/color-modes.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/twbs/bootstrap/site/static/docs/5.3/assets/js/color-modes.js b/vendor/twbs/bootstrap/site/static/docs/5.3/assets/js/color-modes.js
index 9f22daa1b..8a0dabf18 100644
--- a/vendor/twbs/bootstrap/site/static/docs/5.3/assets/js/color-modes.js
+++ b/vendor/twbs/bootstrap/site/static/docs/5.3/assets/js/color-modes.js
@@ -1,6 +1,6 @@
/*!
* Color mode toggler for Bootstrap's docs (https://getbootstrap.com/)
- * Copyright 2011-2023 The Bootstrap Authors
+ * Copyright 2011-2024 The Bootstrap Authors
* Licensed under the Creative Commons Attribution 3.0 Unported License.
*/
@@ -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)
}