Replies: 2 comments 3 replies
-
It is a bit complicated for developers. Make it default? |
Beta Was this translation helpful? Give feedback.
2 replies
-
This is really great news! No matter what CSS solution is used with antd, this will give more control to developers in a really easy and nice (native) way! Thank you for adding I guess |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
📋 RFC
Summary
StyleProvider support
@layer
for ordering priority with other css lib.Basic example
Will export the style as:
Motivation
Ant Design use
@ant-design/cssinjs
lib to dynamic create the style on<header />
which will always move itself at beginning of<header />
.In most case, this helps the customize style as same css selector to override the antd style. But it some time it can help less on the patch update. e.g.
This will break user style:
To keep the antd component style well work with customize style (or other css lib). It should support developer to make antd style order-able.
Detailed
A well ordered style. For example, user use tailwind.css & antd & emotion. The css order should be:
For the configuration of the basic steps (next.js example)
It just need take 2 steps:
1. Wrap antd StyleProvider
Make antd has the
@layer
ofantd
.2. Config global.css
Wrap
@tailwind base
in layer to make it as low priority. And orderantd
aftertailwind: base
.Drawbacks
Need developer to config the
@layer
order.Adoption strategy
@ant-design/cssinjs
lib to supporthashPriority="low"
.@layer
foruseStyleRegister
to make all the component has@layer
info.Beta Was this translation helpful? Give feedback.
All reactions