mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
style: tweak icon-only button font-size to align icon and text (#52353)
* style: tweak icon-only button font-size to align icon and text * fix * fix
This commit is contained in:
parent
88687bbb3c
commit
bd0d445668
@ -698,7 +698,6 @@ const genButtonStyle = (token: ButtonToken, prefixCls = ''): CSSInterpolation =>
|
|||||||
|
|
||||||
[iconCls]: {
|
[iconCls]: {
|
||||||
fontSize: buttonIconOnlyFontSize,
|
fontSize: buttonIconOnlyFontSize,
|
||||||
verticalAlign: 'calc(-0.125em - 1px)',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -160,17 +160,17 @@ export interface ComponentToken {
|
|||||||
* @desc 只有图标的按钮图标尺寸
|
* @desc 只有图标的按钮图标尺寸
|
||||||
* @descEN Icon size of button which only contains icon
|
* @descEN Icon size of button which only contains icon
|
||||||
*/
|
*/
|
||||||
onlyIconSize: number;
|
onlyIconSize: number | string;
|
||||||
/**
|
/**
|
||||||
* @desc 大号只有图标的按钮图标尺寸
|
* @desc 大号只有图标的按钮图标尺寸
|
||||||
* @descEN Icon size of large button which only contains icon
|
* @descEN Icon size of large button which only contains icon
|
||||||
*/
|
*/
|
||||||
onlyIconSizeLG: number;
|
onlyIconSizeLG: number | string;
|
||||||
/**
|
/**
|
||||||
* @desc 小号只有图标的按钮图标尺寸
|
* @desc 小号只有图标的按钮图标尺寸
|
||||||
* @descEN Icon size of small button which only contains icon
|
* @descEN Icon size of small button which only contains icon
|
||||||
*/
|
*/
|
||||||
onlyIconSizeSM: number;
|
onlyIconSizeSM: number | string;
|
||||||
/**
|
/**
|
||||||
* @desc 按钮组边框颜色
|
* @desc 按钮组边框颜色
|
||||||
* @descEN Border color of button group
|
* @descEN Border color of button group
|
||||||
@ -233,7 +233,7 @@ export interface ButtonToken extends FullToken<'Button'> {
|
|||||||
* @desc 只有图标的按钮图标尺寸
|
* @desc 只有图标的按钮图标尺寸
|
||||||
* @descEN Icon size of button which only contains icon
|
* @descEN Icon size of button which only contains icon
|
||||||
*/
|
*/
|
||||||
buttonIconOnlyFontSize: number;
|
buttonIconOnlyFontSize: number | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const prepareToken: (token: Parameters<GenStyleFn<'Button'>>[0]) => ButtonToken = (
|
export const prepareToken: (token: Parameters<GenStyleFn<'Button'>>[0]) => ButtonToken = (
|
||||||
@ -275,9 +275,9 @@ export const prepareComponentToken: GetDefaultToken<'Button'> = (token) => {
|
|||||||
paddingInline: token.paddingContentHorizontal - token.lineWidth,
|
paddingInline: token.paddingContentHorizontal - token.lineWidth,
|
||||||
paddingInlineLG: token.paddingContentHorizontal - token.lineWidth,
|
paddingInlineLG: token.paddingContentHorizontal - token.lineWidth,
|
||||||
paddingInlineSM: 8 - token.lineWidth,
|
paddingInlineSM: 8 - token.lineWidth,
|
||||||
onlyIconSize: token.fontSizeLG,
|
onlyIconSize: 'inherit',
|
||||||
onlyIconSizeSM: token.fontSizeLG - 2,
|
onlyIconSizeSM: 'inherit',
|
||||||
onlyIconSizeLG: token.fontSizeLG + 2,
|
onlyIconSizeLG: 'inherit',
|
||||||
groupBorderColor: token.colorPrimaryHover,
|
groupBorderColor: token.colorPrimaryHover,
|
||||||
linkHoverBg: 'transparent',
|
linkHoverBg: 'transparent',
|
||||||
textTextColor: token.colorText,
|
textTextColor: token.colorText,
|
||||||
|
Loading…
Reference in New Issue
Block a user