Compare commits

..

No commits in common. "67b2eef7ae889fada4908dad792679153fa33b09" and "e2ee67a88867c2f29c2346c04359508158f2962a" have entirely different histories.

View File

@ -10,15 +10,17 @@ const Configure =
hash: false hash: false
} as TW.TwindUserConfig; } as TW.TwindUserConfig;
export const Shadow =(inElement:HTMLElement, inConfig:TW.TwindUserConfig)=> export const Shadow =(inElement:HTMLElement, inConfig?:TW.TwindUserConfig)=>
{ {
const merge = inConfig ? {...Configure, ...inConfig} : Configure;
const ShadowDOM = inElement.attachShadow({ mode: "open" }); const ShadowDOM = inElement.attachShadow({ mode: "open" });
const ShadowDiv = document.createElement("div"); const ShadowDiv = document.createElement("div");
const ShadowCSS = document.createElement("style"); const ShadowCSS = document.createElement("style");
ShadowDOM.append(ShadowCSS); ShadowDOM.append(ShadowCSS);
ShadowDOM.append(ShadowDiv); ShadowDOM.append(ShadowDiv);
TW.observe(TW.twind(inConfig, TW.cssom(ShadowCSS)), ShadowDiv); TW.observe(TW.twind(merge, TW.cssom(ShadowCSS)), ShadowDiv);
return ShadowDiv; return ShadowDiv;
}; };
@ -38,15 +40,13 @@ export default async(inSelector:string, inModulePath:string, inMemberApp="defaul
const module = await import(inModulePath); const module = await import(inModulePath);
const merge = inMemberCSS ? {...Configure, ...module[inMemberCSS]} : Configure;
if(inShadow) if(inShadow)
{ {
dom = Shadow(dom as HTMLElement, merge); dom = Shadow(dom as HTMLElement, module[inMemberCSS]);
} }
else else
{ {
TW.install(merge); TW.install(Configure);
} }
const app = React.createElement(()=> React.createElement(module[inMemberApp], null), null); const app = React.createElement(()=> React.createElement(module[inMemberApp], null), null);