mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
style: remove Space font style (#40326)
* refactor: simplify code * style: fix Space font style * demo: fix Select demo
This commit is contained in:
parent
862ce2eba5
commit
9619c8c37e
@ -38,17 +38,21 @@ const genSpaceStyle: GenerateStyle<SpaceToken> = (token) => {
|
||||
alignItems: 'baseline',
|
||||
},
|
||||
},
|
||||
[`${componentCls}-item`]: {
|
||||
'&:empty': {
|
||||
display: 'none',
|
||||
},
|
||||
[`${componentCls}-item:empty`]: {
|
||||
display: 'none',
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
// ============================== Export ==============================
|
||||
export default genComponentStyleHook('Space', (token) => [
|
||||
genSpaceStyle(token),
|
||||
genSpaceCompactStyle(token),
|
||||
]);
|
||||
export default genComponentStyleHook(
|
||||
'Space',
|
||||
(token) => [genSpaceStyle(token), genSpaceCompactStyle(token)],
|
||||
() => ({}),
|
||||
{
|
||||
// Space component don't apply extra font style
|
||||
// https://github.com/ant-design/ant-design/issues/40315
|
||||
resetStyle: false,
|
||||
},
|
||||
);
|
||||
|
@ -41,6 +41,9 @@ export default function genComponentStyleHook<ComponentName extends OverrideComp
|
||||
getDefaultToken?:
|
||||
| OverrideTokenWithoutDerivative[ComponentName]
|
||||
| ((token: GlobalToken) => OverrideTokenWithoutDerivative[ComponentName]),
|
||||
options?: {
|
||||
resetStyle?: boolean;
|
||||
},
|
||||
) {
|
||||
return (prefixCls: string): UseComponentStyleResult => {
|
||||
const [theme, token, hashId] = useToken();
|
||||
@ -93,7 +96,10 @@ export default function genComponentStyleHook<ComponentName extends OverrideComp
|
||||
overrideComponentToken: token[component],
|
||||
});
|
||||
flush(component, mergedComponentToken);
|
||||
return [genCommonStyle(token, prefixCls), styleInterpolation];
|
||||
return [
|
||||
options?.resetStyle === false ? null : genCommonStyle(token, prefixCls),
|
||||
styleInterpolation,
|
||||
];
|
||||
}),
|
||||
hashId,
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user