mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix: css var polyfill
This commit is contained in:
parent
543cbbce81
commit
cbaee21ded
@ -1,3 +1,7 @@
|
||||
## 2.0.3
|
||||
### Bug fixes
|
||||
- fix: css var polyfill
|
||||
|
||||
## 2.0.2
|
||||
|
||||
### Bug fixes
|
||||
|
||||
@ -14,14 +14,17 @@ export function cssVars () {
|
||||
if (block.nodeName === 'STYLE') {
|
||||
replaceVar(block)
|
||||
} else if (block.nodeName === 'LINK') {
|
||||
load(block.getAttribute('href'))
|
||||
.then(res => {
|
||||
const style = document.createElement('style')
|
||||
const href = block.getAttribute('href')
|
||||
|
||||
style.innerHTML = res
|
||||
document.head.appendChild(style)
|
||||
replaceVar(style)
|
||||
})
|
||||
if (/\.css$/.test(href)) return
|
||||
|
||||
load(href).then(res => {
|
||||
const style = document.createElement('style')
|
||||
|
||||
style.innerHTML = res
|
||||
document.head.appendChild(style)
|
||||
replaceVar(style)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user