2018-12-18 00:43:51 -08:00
|
|
|
export function loadCSS (href) {
|
2019-08-03 13:49:37 -07:00
|
|
|
const existingLink = document.querySelector(`link[href="${href}"]`)
|
2018-12-18 00:43:51 -08:00
|
|
|
|
|
|
|
|
if (existingLink) {
|
|
|
|
|
return
|
|
|
|
|
}
|
2019-08-03 13:49:37 -07:00
|
|
|
const link = document.createElement('link')
|
2018-12-18 00:43:51 -08:00
|
|
|
link.rel = 'stylesheet'
|
|
|
|
|
link.href = href
|
|
|
|
|
|
|
|
|
|
document.head.appendChild(link)
|
|
|
|
|
}
|