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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -