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 68717f82d6..4528ba36b8 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}"]`)