From e34a6a8c6f6ecfe51e2cb5bf0a3231b541fbb850 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 18 Nov 2024 12:03:52 +0800 Subject: [PATCH] fix: Button custom icon is not align center (#51652) --- components/button/style/index.ts | 8 ++------ components/upload/style/list.ts | 10 ++-------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/components/button/style/index.ts b/components/button/style/index.ts index 7613a72488..9b44062b9b 100644 --- a/components/button/style/index.ts +++ b/components/button/style/index.ts @@ -38,12 +38,8 @@ const genSharedButtonStyle: GenerateStyle = (token): CSS pointerEvents: 'none', }, - '> span': { - display: 'inline-block', - }, - - [`${componentCls}-icon`]: { - lineHeight: 1, + [`> span, ${componentCls}-icon`]: { + display: 'inline-flex', }, '> a': { diff --git a/components/upload/style/list.ts b/components/upload/style/list.ts index 03b9b47775..00d6622eb0 100644 --- a/components/upload/style/list.ts +++ b/components/upload/style/list.ts @@ -5,11 +5,10 @@ import { clearFix, textEllipsis } from '../../style'; import type { GenerateStyle } from '../../theme/internal'; const genListStyle: GenerateStyle = (token) => { - const { componentCls, antCls, iconCls, fontSize, lineHeight, calc } = token; + const { componentCls, iconCls, fontSize, lineHeight, calc } = token; const itemCls = `${componentCls}-list-item`; const actionsCls = `${itemCls}-actions`; const actionCls = `${itemCls}-action`; - const listItemHeightSM = token.fontHeightSM; return { [`${componentCls}-wrapper`]: { @@ -25,6 +24,7 @@ const genListStyle: GenerateStyle = (token) => { display: 'flex', alignItems: 'center', transition: `background-color ${token.motionDurationSlow}`, + borderRadius: token.borderRadiusSM, '&:hover': { backgroundColor: token.controlItemBgHover, @@ -56,12 +56,6 @@ const genListStyle: GenerateStyle = (token) => { `]: { opacity: 1, }, - - [`${actionCls}${antCls}-btn`]: { - height: listItemHeightSM, - border: 0, - lineHeight: 1, - }, }, [`${componentCls}-icon ${iconCls}`]: {