Skip to content

Commit

Permalink
Revert "Guard more in color-modes.js (#38235)" (#38280)
Browse files Browse the repository at this point in the history
This reverts commit 474bf2a.
  • Loading branch information
mdo authored Mar 20, 2023
1 parent 2d0c94c commit 6855ce9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/static/docs/5.3/assets/js/color-modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@

const showActiveTheme = (theme, focus = false) => {
const themeSwitcher = document.querySelector('#bd-theme')
const themeSwitcherText = document.querySelector('#bd-theme-text')

if (!themeSwitcher || !themeSwitcherText) {
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}"]`)
const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href')
Expand Down

0 comments on commit 6855ce9

Please sign in to comment.