MCPcopy
hub / github.com/react-bootstrap/react-bootstrap / injectCss

Function injectCss

test/helpers.ts:4–20  ·  view source on GitHub ↗
(rules: string)

Source from the content-addressed store, hash-verified

2let seen: string[] = [];
3
4export function injectCss(rules: string) {
5 if (seen.indexOf(rules) !== -1) {
6 return;
7 }
8
9 style =
10 style ||
11 (function iife() {
12 const _style = document.createElement('style');
13 _style.appendChild(document.createTextNode(''));
14 document.head.appendChild(_style);
15 return _style;
16 })();
17
18 seen.push(rules);
19 style.innerHTML += `\n${rules}`;
20}
21
22injectCss.reset = () => {
23 if (style) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…