feat: add new config config.getCommonStyle
config.getCompUnitless
for genStyleUtils
#10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 这个变动的性质是?
🔗 相关 Issue
无
💡 需求背景和解决方案
genStyleUtils
新增属性在用
@ant-design/cssinjs-utils
重构antd
的过程中,发现的问题:genCommonStyle
函数被genComponentStyleHook
使用,@ant-design/cssinjs-utils@1.0.0
版本将其扩展为genComponentStyleHook
函数的options.genCommonStyle
属性。这会导致一些问题:genComponentStyleHook
都需要将options.genCommonStyle
传入useStyle
时会多一次函数调用另外考虑参数命名的一致性,将
genCommonStyle
更名为getCommonStyle
。原
unitless
常量被genStyleHooks
中使用,考虑通用性,将其抽象为config.getCompUnitless
。修复
修复了
genComponentStyleHook
内部的逻辑问题,该问题会导致基础样式异常。📝 更新日志
config.getCommonStyle
config.getCompUnitless
forgenStyleUtils
genStyleUtils
新增配置属性config.getCommonStyle
config.getCompUnitless