()
| 91 | return specificity.join("\n"); |
| 92 | } |
| 93 | export function fix() { |
| 94 | if (!CSS.supports("selector(&)")) { |
| 95 | fetch("/style.css") |
| 96 | .then((_) => _.text()) |
| 97 | .then((txt) => { |
| 98 | const link = Array.from(document.getElementsByTagName("link")).find((_) => |
| 99 | _.href.endsWith("/style.css"), |
| 100 | ); |
| 101 | if (!link) { |
| 102 | alert("link not found"); |
| 103 | return; |
| 104 | } |
| 105 | const css = unnest(txt); |
| 106 | console.log(css); |
| 107 | |
| 108 | const style = document.createElement("style"); |
| 109 | style.textContent = css; |
| 110 | link.after(style); |
| 111 | link.remove(); |
| 112 | }); |
| 113 | } |
| 114 | } |