mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
fix: default cssvarkey only picked when component themeconfig && parent th… (#50377)
* fix: default cssvarkey picked when component themeconfig && parent themeconfig not setted at the same time 只有当组件theme和parentTheme都没有设置cssvarkey时,才使用默认的cssvarkey Signed-off-by: zhuzhu_coder <zjczoo@gmail.com> * Apply suggestions from code review Signed-off-by: afc163 <afc163@gmail.com> * Update components/config-provider/hooks/useTheme.ts Signed-off-by: afc163 <afc163@gmail.com> * Update components/config-provider/hooks/useTheme.ts Signed-off-by: afc163 <afc163@gmail.com> --------- Signed-off-by: zhuzhu_coder <zjczoo@gmail.com> Signed-off-by: afc163 <afc163@gmail.com> Co-authored-by: afc163 <afc163@gmail.com>
This commit is contained in:
parent
b0308b60a5
commit
3284536605
@ -64,7 +64,9 @@ export default function useTheme(
|
||||
prefix: config?.prefixCls, // Same as prefixCls by default
|
||||
...(typeof parentThemeConfig.cssVar === 'object' ? parentThemeConfig.cssVar : {}),
|
||||
...(typeof themeConfig.cssVar === 'object' ? themeConfig.cssVar : {}),
|
||||
key: (typeof themeConfig.cssVar === 'object' && themeConfig.cssVar?.key) || cssVarKey,
|
||||
key: (typeof themeConfig.cssVar === 'object' && themeConfig.cssVar?.key)
|
||||
|| (typeof parentThemeConfig.cssVar === 'object' && parentThemeConfig.cssVar?.key)
|
||||
|| cssVarKey,
|
||||
};
|
||||
|
||||
// Base token
|
||||
|
Loading…
Reference in New Issue
Block a user