MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / addStyle

Function addStyle

src/app/service/content/utils.ts:248–255  ·  view source on GitHub ↗
(css: string)

Source from the content-addressed store, hash-verified

246}
247
248export 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
257export function addStyleSheet(css: string): CSSStyleSheet {
258 // see https://unarist.hatenablog.com/entry/2020/07/06/012540

Callers 1

utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected