date-time-picker
date-time-picker copied to clipboard
CSS style not imported in web component
When using ViewEncapsulation.ShadowDom external lib css is not being imported in custom element component. Dynamic Form Component is defined as Custom Element which uses custom lib that imports date-time-picker.
/**
* Application bootstrap
*/
ngDoBootstrap(): void {
const dynamicFormElement = createCustomElement(DynamicFormComponent, {
injector: this.injector,
});
// Update module configuration. Add shadow root object.
customElements.define(WEB_CMP_SELECTOR, dynamicFormElement);
const el = this.document.querySelector(WEB_CMP_SELECTOR);
if (el && el.shadowRoot) {
config.SHADOW_ROOT = el.shadowRoot;
}
}
Dynamic Component css file
// this import is not working
@import "~@danielmoncada/angular-datetime-picker/assets/style/picker.min.css";
:host {
font-family: "Raleway"....
}
And from the image below we can see that style is added in shadowRoot but it is still messed up.

May i know, Why this issue got closed without any reply. i am looking for solution of this problem
May i know, Why this issue got closed without any reply. i am looking for solution of this problem
Never heard back from OP.
I'll re-open, thanks for replying.