javascript - How to select :host with a class in css for web components? -
in new v1 web components specs, can use :host
target custom element. attached class a
custom element, , had css selector :host.a
, styles not being applied. know how fix this?
thanks
as per documentation:
for example, had component shadow tree following:
<x-foo class="foo"> <"shadow tree"> <div class="foo">...</div> </> </x-foo>
for stylesheet within shadow tree:
- ...
- '
:host(.foo)
' matches<x-foo>
element.
as op has commented, would, in case, translate to:
:host(.a) { ... }
Comments
Post a Comment