fix: css var polyfill
This commit is contained in:
parent
543cbbce81
commit
cbaee21ded
2 changed files with 14 additions and 7 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
## 2.0.3
|
||||||
|
### Bug fixes
|
||||||
|
- fix: css var polyfill
|
||||||
|
|
||||||
## 2.0.2
|
## 2.0.2
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
|
||||||
|
|
@ -14,14 +14,17 @@ export function cssVars () {
|
||||||
if (block.nodeName === 'STYLE') {
|
if (block.nodeName === 'STYLE') {
|
||||||
replaceVar(block)
|
replaceVar(block)
|
||||||
} else if (block.nodeName === 'LINK') {
|
} else if (block.nodeName === 'LINK') {
|
||||||
load(block.getAttribute('href'))
|
const href = block.getAttribute('href')
|
||||||
.then(res => {
|
|
||||||
const style = document.createElement('style')
|
|
||||||
|
|
||||||
style.innerHTML = res
|
if (/\.css$/.test(href)) return
|
||||||
document.head.appendChild(style)
|
|
||||||
replaceVar(style)
|
load(href).then(res => {
|
||||||
})
|
const style = document.createElement('style')
|
||||||
|
|
||||||
|
style.innerHTML = res
|
||||||
|
document.head.appendChild(style)
|
||||||
|
replaceVar(style)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue