shadow dom - How to apply external CSS to an external component within my angular component or using external CSS to the nested external component only -
i beginner, terminologies used here might not applied.
my app has 3 components. 1 external component clr-datagrid project clarity
<body> <app-root> <app-searchform> <ss-multiselect-dropdown> external library making dropdown multiselect bootstrap css </ss-multiselect-dropdown> </app-searchform> <app-searchresult> <clr-datagrid> external component displaying result list </clr-datagrid> </app-searchresult> </app-root> </body>
in searchresult component,
@component({ selector: 'app-searchresult', templateurl: './searchresult.component.html', styleurls: ['./searchresult.component.css', '../../../node_modules/clarity-icons/clarity-icons.min.css', '../../../node_modules/clarity-ui/clarity-ui.min.css' ], encapsulation: viewencapsulation.emulated })
the problem is,
when use viewencapsulation.emulated, clarity-icons.min.css', clarity-ui.min.css not applied nested component/ custom-element.
when use viewencapsulation.native, works in chrome , opera browsers. not in ie/ firefox/ safari.
when use viewencapsulation.none, works fine css bleed out , affect searhform cmp styles.
what have understood online reading problem shadow dom, chrome support shadow dom, others not. tried use webcomponents polyfill
<script src="../../../node_modules/webcomponents.js/webcomponents-hi-sd-ce.js"></script>
in index.html (may not right way).
could plz me how can apply clarity css , icons component, , not affect other parts of app ?
Comments
Post a Comment