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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -