(css: string)
| 246 | } |
| 247 | |
| 248 | export function addStyle(css: string): HTMLStyleElement { |
| 249 | const dom = document.createElement("style"); |
| 250 | dom.textContent = css; |
| 251 | if (document.head) { |
| 252 | return document.head.appendChild(dom); |
| 253 | } |
| 254 | return document.documentElement.appendChild(dom); |
| 255 | } |
| 256 | |
| 257 | export function addStyleSheet(css: string): CSSStyleSheet { |
| 258 | // see https://unarist.hatenablog.com/entry/2020/07/06/012540 |