gpt4 book ai didi

angularjs - 为什么 Angular Material2 使用 ViewEncapsulation.None 而不是 Emulated 或 Native?

转载 作者:太空狗 更新时间:2023-10-29 19:31:00 28 4
gpt4 key购买 nike

在 Material2 项目中,每个组件都使用 ViewEncapsulation.None。 (例如 MdButton )

最近,md-toolbar 的封装刚刚更改为无.

为什么会这样?封装 CSS 的可能性不是使用 Angular2 创建此类框架的最大优势之一吗?

聚合物组件似乎使用了此功能。为什么 Material2 没有?

最佳答案

不久前 /deep/>>> 是为 ViewEncapsulation.Emulated 实现的,因此应该很容易设置相同的样式使用 ViewEncapsulation.None

我能想到的唯一原因是 SASS(或他们使用的任何预处理器)不支持这些 CSS 组合器,因为它们在 Chrome 中已弃用近一年,并且从未在其他浏览器中实现。

关于angularjs - 为什么 Angular Material2 使用 ViewEncapsulation.None 而不是 Emulated 或 Native?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38583377/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com