MCPcopy Create free account
hub / github.com/dabbott/javascript-playgrounds / appendCSS

Function appendCSS

utils/Styles.js:2–13  ·  view source on GitHub ↗
(css)

Source from the content-addressed store, hash-verified

1
2export const appendCSS = (css) => {
3 const element = document.createElement('style');
4 element.type = 'text/css';
5
6 if (element.styleSheet) {
7 element.styleSheet.cssText = css;
8 } else {
9 element.appendChild(document.createTextNode(css));
10 }
11
12 document.head.appendChild(element);
13}

Callers 2

index.jsFile · 0.90
player.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected