::shadow 和/deep/的替代品是什么? [英] What's the substitute for ::shadow and /deep/?
本文介绍了::shadow 和/deep/的替代品是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如 https://www.chromestatus.com/中所述,已弃用两个穿透阴影的组合器features/6750456638341120
那么实现相同目标的替代方法是什么,或者这种穿透阴影的功能已被完全放弃?
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?
推荐答案
::shadow
和 /deep/
因破坏封装而被移除.
::shadow
and /deep/
were removed for breaking encapsulation.
替代品是:
- CSS 变量.它已经与最近推出的 Google Chrome 49 原生兼容.阅读此处:
- CSS variables. It already works natively with the recently launched Google Chrome 49. Read here:
- http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/
- https://developers.google.com/web/updates/2016/02/css-variables-why-should-you-care?hl=en
- http://blog.chromium.org/2016/02/chrome-49-beta-css-custom-properties.html
:主机上下文
.在这里阅读:http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/
:host-context
. Read here: http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/这篇关于::shadow 和/deep/的替代品是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文