New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
className prop ordering #26602
className prop ordering #26602
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0c3dc16:
|
Codecov Report
@@ Coverage Diff @@
## master #26602 +/- ##
==========================================
+ Coverage 98.38% 99.82% +1.43%
==========================================
Files 364 383 +19
Lines 7320 7348 +28
Branches 1957 2055 +98
==========================================
+ Hits 7202 7335 +133
+ Misses 118 13 -105
Continue to review full report at Codecov.
|
@afc163 @zombieJ 不懂更改顺序会有什么变化,请指教下。 比如其中的一个 change
className 只能增量,不能删减antd的样式吧?覆盖也是没意义吧?就是一个 string 而已,相当于没变化。 |
而且在同一个节点的 classname 顺序不同,应该优先级不变; |
好像还是有点区别的,当两个css的选择器优先级不同时 |
其实这个 merge 改的就是 classNames 的参数顺序,最终也就是 className 字符串中的顺序, class 属性的顺序没关系 × |
你是对的,确实没关系。 改就改了吧。 |
ok。 |
也还是应该放后面
|
对的,视觉上从前往后第一眼能看出来是什么,避免看到一堆自定义的 className。 |
🤔 This is a ...
🔗 Related issue link
#26594
💡 Background and solution
Currently most of the Ant Design components are defined as follows:
const class = classNames(userDefinedClassName, componentClassName, ...)
Which makes ant classNames take precedence over user defined classNames. As a user, I would like to easily override ant-d classNames.
☑️ Self Check before Merge
resolve #26594