fix(core): update

This commit is contained in:
2021-05-19 11:32:12 +00:00
parent 602fa2b7ff
commit 35f7bdd984
4 changed files with 37 additions and 4 deletions

View File

@ -39,6 +39,8 @@ export function serializeFunction(rootNode) {
const nodeUUID = uuidv4();
nodeArg.classList.add(nodeUUID);
// find all slots
const slots = nodeArg.shadowRoot.querySelectorAll('slot');
// handle slot element
@ -59,6 +61,14 @@ export function serializeFunction(rootNode) {
const childNodes = nodeArg.shadowRoot.childNodes;
// tslint:disable-next-line: prefer-for-of
const noteForAppending: HTMLElement[] = [];
// lets care about static css first
if ((nodeArg.constructor as any).styles?.cssText) {
const styleTag = document.createElement('style');
styleTag.textContent = prependCss(nodeUUID, (nodeArg.constructor as any).styles.cssText);
noteForAppending.push(styleTag);
}
childNodes.forEach((childNode) => {
if (childNode instanceof HTMLElement) {
if (childNode.tagName === 'STYLE') {