chayns-components
Version:
A set of beautiful React components for developing chayns® applications.
21 lines (19 loc) • 525 B
JavaScript
;
exports.__esModule = true;
exports.default = insertStyle;
const styleMap = new Map();
function insertStyle(id, css) {
let styleTag = styleMap.get(id);
if (!styleTag) {
styleTag = document.createElement('style');
styleTag.type = 'text/css';
document.head.appendChild(styleTag);
styleMap.set(id, styleTag);
}
if (styleTag.styleSheet) {
styleTag.styleSheet.cssText = css;
} else {
styleTag.appendChild(document.createTextNode(css));
}
}
//# sourceMappingURL=insertStyle.js.map