aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Déramond <[email protected]>2023-02-17 07:56:30 +0100
committerGitHub <[email protected]>2023-02-17 08:56:30 +0200
commit31221272e0bbea1e436699cd5d68f705f37d3361 (patch)
tree2f7526ba789cdb76f870d7c90fbe3bbefd099277
parent42e99cc59f6e87795e25d751bcfaf3be711191b4 (diff)
downloadbootstrap-31221272e0bbea1e436699cd5d68f705f37d3361.tar.xz
bootstrap-31221272e0bbea1e436699cd5d68f705f37d3361.zip
Fix console error in examples pages du to no theme switcher (#38074)
-rw-r--r--site/static/docs/5.3/assets/js/color-modes.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/site/static/docs/5.3/assets/js/color-modes.js b/site/static/docs/5.3/assets/js/color-modes.js
index 68717f82d..4528ba36b 100644
--- a/site/static/docs/5.3/assets/js/color-modes.js
+++ b/site/static/docs/5.3/assets/js/color-modes.js
@@ -29,6 +29,11 @@
const showActiveTheme = (theme, focus = false) => {
const themeSwitcher = document.querySelector('#bd-theme')
+
+ if (!themeSwitcher) {
+ return
+ }
+
const themeSwitcherText = document.querySelector('#bd-theme-text')
const activeThemeIcon = document.querySelector('.theme-icon-active use')
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)