You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I upgraded tailwindcss version from v3 to v4, and had to use "layer" feature to adjust priority of tailwind base and antd style. (The App component is wrapped with <ConfigProvider>, <StyleProvider layer={true} />)
When that "antd" value is passed to IconProvider, it attach @layer antd to anticon style, and the order of layer will be changed. The layer order setting in global.css is ignored.
The situation above occurred because I used another ConfigProvider in custom component module(ex: ConfigProvider -> StyleProvider -> IconProvider -> ConfigProvider). In the inner ConfigProvider, it doesn't get parent IconContext values. So I solved this problem by removing inner ConfigProvider and setting 'custom name' to IconProvider layer props.
However, with this antd icon "prepend" option, other situations might arise where the antd layer comes to the topmost layer, so I'm raising this as an issue.
This situation can be reproduced by setting IconProvider's layer value to 'antd'. <IconProvider key="icon-provider" value={{ layer: 'antd' }} />
The text was updated successfully, but these errors were encountered:
minjinso
changed the title
using antd icons with CSS layer
Using antd icons with CSS layer, tailwindcss v4
Feb 5, 2025
<ConfigProvider>, <StyleProvider layer={true} />
)ant-design-icons/packages/icons-react/src/utils.ts
Line 174 in 306fe9f
@layer antd
to anticon style, and the order of layer will be changed. The layer order setting in global.css is ignored.The situation above occurred because I used another ConfigProvider in custom component module(ex: ConfigProvider -> StyleProvider -> IconProvider -> ConfigProvider). In the inner ConfigProvider, it doesn't get parent IconContext values. So I solved this problem by removing inner ConfigProvider and setting 'custom name' to IconProvider layer props.
However, with this antd icon "prepend" option, other situations might arise where the antd layer comes to the topmost layer, so I'm raising this as an issue.
This situation can be reproduced by setting IconProvider's layer value to 'antd'.
<IconProvider key="icon-provider" value={{ layer: 'antd' }} />
The text was updated successfully, but these errors were encountered: