Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug] Antd 样式开启 layer 分层后引入 x 库会导致样式混乱 #1588

@ilxqx

Description

@ilxqx

重现步骤

在线示例链接:https://codesandbox.io/p/devbox/vigilant-cookies-j2sq88

步骤:

  1. 打开重现链接
  2. 即可观察到样式混乱的表现,可以修改 useLayer = false 后它自动刷新页面又回归正常,可以确定是 layer 的问题
  3. 可以排查到是 x 库不兼容 layer 模式导致的

当前行为

开启 layer 样式,会导致 antd 组件样式混乱(覆盖)

预期行为

一切正常

上下文

使用 layer 有一个很大的好处,就是覆盖 antd 的样式我们不需要 !important 大法,所以我们的项目都是使用 layer 样式模式。希望 antd-x 组件库也可以支持 layer 模式,这样我们覆盖样式也会更舒服一些,而且也不会导致现有的 antd 组件样式被覆盖了。

版本

v2.1.1

您在哪些浏览器上遇到了这个问题?

Chrome

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions