Skip to content

Commit

Permalink
fix: font-family for components (#39806)
Browse files Browse the repository at this point in the history
* fix: font-family for components

* chore: code clean
  • Loading branch information
MadCcc committed Dec 26, 2022
1 parent 663d145 commit c1390b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion components/style/index.tsx
Expand Up @@ -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}"]`;

return {
[rootPrefixSelector]: {
fontFamily,
fontSize,
boxSizing: 'border-box',

'&::before, &::after': {
Expand Down
2 changes: 1 addition & 1 deletion components/theme/util/genComponentStyleHook.ts
Expand Up @@ -87,7 +87,7 @@ export default function genComponentStyleHook<ComponentName extends OverrideComp
overrideComponentToken: token[component],
});
flush(component, mergedComponentToken);
return [genCommonStyle(prefixCls), styleInterpolation];
return [genCommonStyle(token, prefixCls), styleInterpolation];
},
),
hashId,
Expand Down

0 comments on commit c1390b2

Please sign in to comment.