0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-02-19 16:54:24 +01:00

Revert "Guard more in color-modes.js (#38235)" (#38280)

This reverts commit 474bf2aed1c03cf53e2d2c48b30c5e689dd9e6bc.
This commit is contained in:
Mark Otto 2023-03-19 17:35:57 -07:00 committed by GitHub
parent 2d0c94c05a
commit 6855ce9512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')