mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
fix: font-family for components (#39806)
* fix: font-family for components * chore: code clean
This commit is contained in:
parent
663d1454f2
commit
c1390b20a9
@ -103,11 +103,15 @@ export const genLinkStyle = (token: DerivativeToken): CSSObject => ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const genCommonStyle = (componentPrefixCls: string): CSSObject => {
|
export const genCommonStyle = (token: DerivativeToken, componentPrefixCls: string): CSSObject => {
|
||||||
|
const { fontFamily, fontSize } = token;
|
||||||
|
|
||||||
const rootPrefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`;
|
const rootPrefixSelector = `[class^="${componentPrefixCls}"], [class*=" ${componentPrefixCls}"]`;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
[rootPrefixSelector]: {
|
[rootPrefixSelector]: {
|
||||||
|
fontFamily,
|
||||||
|
fontSize,
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
|
|
||||||
'&::before, &::after': {
|
'&::before, &::after': {
|
||||||
|
@ -87,7 +87,7 @@ export default function genComponentStyleHook<ComponentName extends OverrideComp
|
|||||||
overrideComponentToken: token[component],
|
overrideComponentToken: token[component],
|
||||||
});
|
});
|
||||||
flush(component, mergedComponentToken);
|
flush(component, mergedComponentToken);
|
||||||
return [genCommonStyle(prefixCls), styleInterpolation];
|
return [genCommonStyle(token, prefixCls), styleInterpolation];
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
hashId,
|
hashId,
|
||||||
|
Loading…
Reference in New Issue
Block a user