MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / ensureStyleElement

Function ensureStyleElement

src/lib/fonts.js:321–328  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

319}
320
321function ensureStyleElement(id) {
322 const selector = `style#${id}`;
323 const $style = tag.get(selector) ?? <style id={id}></style>;
324 if (!$style.isConnected) {
325 document.head.append($style);
326 }
327 return $style;
328}
329
330export default {
331 add,

Callers 4

setEditorFontFunction · 0.85
setAppFontFunction · 0.85
injectFontFaceFunction · 0.85
loadFontFunction · 0.85

Calls 2

appendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected