(url)
| 1 | import { $el } from "../../../../scripts/ui.js"; |
| 2 | |
| 3 | export function addStylesheet(url) { |
| 4 | if (url.endsWith(".js")) { |
| 5 | url = url.substr(0, url.length - 2) + "css"; |
| 6 | } |
| 7 | $el("link", { |
| 8 | parent: document.head, |
| 9 | rel: "stylesheet", |
| 10 | type: "text/css", |
| 11 | href: url.startsWith("http") ? url : getUrl(url), |
| 12 | }); |
| 13 | } |
| 14 | |
| 15 | export function getUrl(path, baseUrl) { |
| 16 | if (baseUrl) { |
no test coverage detected