Shadow DOM styling from the outside

后端 未结 3 1630
难免孤独
难免孤独 2020-12-20 12:12

I am searching a way to styling shadow DOM from the outside. For example, I would like to set the color of all text in all \'span.special\' elements as RED. Including \'span

3条回答
  •  天命终不由人
    2020-12-20 12:34

    You could use @import css as explained in this answer to another question on SO.

    Include the rule inside the style element in the shadow tree.

     
    

    Note that the >>> combinator is still part of the CSS Scoping Module Draft.

提交回复
热议问题