1 | export const injectStyleSheet = styles => {
|
2 | const styleTag = document.createElement('style');
|
3 | styleTag.setAttribute('type', 'text/css');
|
4 | styleTag.textContent = styles;
|
5 | document.head.appendChild(styleTag);
|
6 | return styleTag;
|
7 | };
|
8 |
|
9 | export const injectRuleSet = (selector, declarations) =>
|
10 | injectStyleSheet(`
|
11 | ${selector} {
|
12 | ${Object.entries(declarations).map(([property, value]) => `${property}: ${value};`).join(`
|
13 | `)}
|
14 | }`);
|