refactor(rollup): treeshakable
This commit is contained in:
@@ -26,3 +26,14 @@ export function useNodeOrEdgeTypes(nodeOrEdgeTypes: any, createTypes: any): any
|
||||
|
||||
return typesParsed;
|
||||
}
|
||||
|
||||
export default function injectStyle(css: string): void {
|
||||
if (!css || typeof document === 'undefined') return;
|
||||
|
||||
const head = document.head || document.getElementsByTagName('head')[0];
|
||||
const style = document.createElement('style');
|
||||
|
||||
head.appendChild(style);
|
||||
|
||||
style.appendChild(document.createTextNode(css));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user