MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / setStyleSheet

Function setStyleSheet

packages/sdk/src/engine/model.ts:293–308  ·  view source on GitHub ↗
(document: Document, css: string)

Source from the content-addressed store, hash-verified

291}
292
293export function setStyleSheet(document: Document, css: string): void {
294 const existing = findStyleElement(document);
295 if (!css) {
296 existing?.remove();
297 return;
298 }
299 let el = existing;
300 if (!el) {
301 el = document.createElement("style") as unknown as Element;
302 const head =
303 (document.querySelector("head") as unknown as Element | null) ??
304 (document.body as unknown as Element);
305 (head as any).appendChild(el);
306 }
307 el.textContent = css;
308}
309
310// ─── GSAP script helpers ──────────────────────────────────────────────────────
311

Callers 2

applyOneFunction · 0.85
handleSetClassStyleFunction · 0.85

Calls 2

findStyleElementFunction · 0.85
querySelectorMethod · 0.65

Tested by

no test coverage detected