You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
575 B
JavaScript
14 lines
575 B
JavaScript
export default function updateTheme (data) {
|
|
const querySelectorName = data === false ? false : !data ? '.el-button--primary' : data
|
|
if (querySelectorName) {
|
|
window.requestAnimationFrame(() => {
|
|
const primaryButton = document.querySelector(querySelectorName)
|
|
if (primaryButton) {
|
|
const backgroundColor = window.getComputedStyle(primaryButton).getPropertyValue('background-color')
|
|
const element = document.querySelector('.bs-body-theme-wrap')
|
|
element.style.setProperty('--bs-el-color-primary', backgroundColor)
|
|
}
|
|
})
|
|
}
|
|
}
|