The two shadow-piercing combinators have been deprecated as stated in https://www.chromestatus.com/features/6750456638341120
Then what's the substitude for achieving the same thing, or this shadow-piercing feature has been completely abandoned?
相关问题
- 反爬能检测到JS模拟的键盘输入吗
- 有没有方法即使程序最小化也能对其发送按键
- Using relative links in Blogger
- How to resolve SAS URL for Storage Account in RM T
- Shadow DOM CSS Styling from outside is not working
The problem is that
::shadow
and/deep/
break encapsulation. I am glad they are gone.The good substitutes are:
:host-context
. Read here: http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/As of Polymer 2:
::shadow
(shadow-piercing selectors) - there is no direct substitute. Instead a custom CSS properties has to be used. Polymer 2: Custom CSS Properties/deep/
- there is some sort of replacement by defining:host > * { ... }
(applies a ruleset to all of the top-level children in the host's shadow tree, which doesn't conflict with the rule in the main document).For more detailed information check Polymer 2 Upgrade Notes