From ddcdb2a6a2a0d2674b57a79cfe2cfac6d1835d22 Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Tue, 6 Aug 2024 00:04:28 +0800 Subject: [PATCH] chore: update unit value (#50258) --- components/calendar/style/index.ts | 6 +++--- components/color-picker/style/input.ts | 2 +- components/color-picker/style/slider.ts | 3 +-- components/modal/style/index.ts | 4 ++-- components/pagination/style/index.ts | 4 ++-- components/steps/style/custom-icon.ts | 2 +- components/steps/style/index.ts | 4 ++-- components/steps/style/progress-dot.ts | 4 ++-- components/steps/style/small.ts | 6 +++--- components/steps/style/vertical.ts | 4 ++-- components/style/roundedArrow.ts | 3 ++- components/switch/style/index.ts | 2 +- components/tree/style/index.ts | 10 +++++----- 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/components/calendar/style/index.ts b/components/calendar/style/index.ts index 06c170b2f6..50a7359f51 100644 --- a/components/calendar/style/index.ts +++ b/components/calendar/style/index.ts @@ -107,7 +107,7 @@ export const genCalendarStyles = (token: CalendarToken): CSSObject => { th: { height: 'auto', padding: 0, - lineHeight: `${unit(token.weekHeight)}`, + lineHeight: unit(token.weekHeight), }, }, [`${componentCls}-cell::before`]: { @@ -129,7 +129,7 @@ export const genCalendarStyles = (token: CalendarToken): CSSObject => { height: 'auto', paddingInlineEnd: token.paddingSM, paddingBottom: token.paddingXXS, - lineHeight: `${unit(token.weekHeight)}`, + lineHeight: unit(token.weekHeight), }, }, }, @@ -170,7 +170,7 @@ export const genCalendarStyles = (token: CalendarToken): CSSObject => { borderRadius: 0, transition: `background ${token.motionDurationSlow}`, '&-value': { - lineHeight: `${unit(token.dateValueHeight)}`, + lineHeight: unit(token.dateValueHeight), transition: `color ${token.motionDurationSlow}`, }, '&-content': { diff --git a/components/color-picker/style/input.ts b/components/color-picker/style/input.ts index 09cde3f600..a5f671f743 100644 --- a/components/color-picker/style/input.ts +++ b/components/color-picker/style/input.ts @@ -56,7 +56,7 @@ const genInputStyle: GenerateStyle = (token) => { [`${antCls}-select-selection-item`]: { paddingInlineEnd: token.calc(fontSizeIcon).add(marginXXS).equal(), fontSize: fontSizeSM, - lineHeight: `${unit(controlHeightSM)}`, + lineHeight: unit(controlHeightSM), }, [`${antCls}-select-item-option-content`]: { fontSize: fontSizeSM, diff --git a/components/color-picker/style/slider.ts b/components/color-picker/style/slider.ts index ef66f5f990..df0138dc99 100644 --- a/components/color-picker/style/slider.ts +++ b/components/color-picker/style/slider.ts @@ -38,8 +38,7 @@ const genSliderStyle: GenerateStyle = (token) => { return { // ======================== Slider ======================== [`${componentCls}-slider`]: [ - getTransBg(`${unit(colorPickerSliderHeight)}`, token.colorFillSecondary), - + getTransBg(unit(colorPickerSliderHeight), token.colorFillSecondary), { margin: 0, padding: 0, diff --git a/components/modal/style/index.ts b/components/modal/style/index.ts index 81b5db4a05..d02c1a62c7 100644 --- a/components/modal/style/index.ts +++ b/components/modal/style/index.ts @@ -7,8 +7,8 @@ import type { AliasToken, FullToken, GenerateStyle, - GlobalToken, GenStyleFn, + GlobalToken, TokenWithCommonCls, } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; @@ -242,7 +242,7 @@ const genModalStyle: GenerateStyle = (token) => { display: 'flex', fontSize: token.fontSizeLG, fontStyle: 'normal', - lineHeight: `${unit(token.modalCloseBtnSize)}`, + lineHeight: unit(token.modalCloseBtnSize), justifyContent: 'center', textTransform: 'none', textRendering: 'auto', diff --git a/components/pagination/style/index.ts b/components/pagination/style/index.ts index 91081ba5a9..b7a61806a4 100644 --- a/components/pagination/style/index.ts +++ b/components/pagination/style/index.ts @@ -10,7 +10,7 @@ import { import type { SharedComponentToken, SharedInputToken } from '../../input/style/token'; import { genBaseOutlinedStyle, genDisabledStyle } from '../../input/style/variants'; import { genFocusOutline, genFocusStyle, resetComponent } from '../../style'; -import type { FullToken, GenerateStyle, GetDefaultToken, GenStyleFn } from '../../theme/internal'; +import type { FullToken, GenerateStyle, GenStyleFn, GetDefaultToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal'; export interface ComponentToken { @@ -400,7 +400,7 @@ const genPaginationJumpStyle: GenerateStyle = (token height: token.itemSize, color: token.colorText, fontFamily: token.fontFamily, - lineHeight: `${unit(token.itemSize)}`, + lineHeight: unit(token.itemSize), textAlign: 'center', verticalAlign: 'middle', listStyle: 'none', diff --git a/components/steps/style/custom-icon.ts b/components/steps/style/custom-icon.ts index a23db96a14..84019e1b29 100644 --- a/components/steps/style/custom-icon.ts +++ b/components/steps/style/custom-icon.ts @@ -18,7 +18,7 @@ const genStepsCustomIconStyle: GenerateStyle = (token) => width: customIconSize, height: customIconSize, fontSize: customIconFontSize, - lineHeight: `${unit(customIconSize)}`, + lineHeight: unit(customIconSize), }, }, }, diff --git a/components/steps/style/index.ts b/components/steps/style/index.ts index 352de57230..1ac60ce09a 100644 --- a/components/steps/style/index.ts +++ b/components/steps/style/index.ts @@ -232,7 +232,7 @@ const genStepsItemStyle: GenerateStyle = (token) => { marginInlineEnd: token.marginXS, fontSize: token.iconFontSize, fontFamily: token.fontFamily, - lineHeight: `${unit(token.iconSize)}`, + lineHeight: unit(token.iconSize), textAlign: 'center', borderRadius: token.iconSize, border: `${unit(token.lineWidth)} ${token.lineType} transparent`, @@ -266,7 +266,7 @@ const genStepsItemStyle: GenerateStyle = (token) => { paddingInlineEnd: token.padding, color: token.colorText, fontSize: token.fontSizeLG, - lineHeight: `${unit(token.titleLineHeight)}`, + lineHeight: unit(token.titleLineHeight), '&::after': { position: 'absolute', diff --git a/components/steps/style/progress-dot.ts b/components/steps/style/progress-dot.ts index 3dd12756be..82b86525b8 100644 --- a/components/steps/style/progress-dot.ts +++ b/components/steps/style/progress-dot.ts @@ -45,7 +45,7 @@ const genStepsProgressDotStyle: GenerateStyle = (token) = height: dotSize, marginInlineStart: token.calc(token.descriptionMaxWidth).sub(dotSize).div(2).equal(), paddingInlineEnd: 0, - lineHeight: `${unit(dotSize)}`, + lineHeight: unit(dotSize), background: 'transparent', border: 0, @@ -82,7 +82,7 @@ const genStepsProgressDotStyle: GenerateStyle = (token) = top: token.calc(dotSize).sub(dotCurrentSize).div(2).equal(), width: dotCurrentSize, height: dotCurrentSize, - lineHeight: `${unit(dotCurrentSize)}`, + lineHeight: unit(dotCurrentSize), background: 'none', marginInlineStart: token .calc(token.descriptionMaxWidth) diff --git a/components/steps/style/small.ts b/components/steps/style/small.ts index cdef71ac4c..216b66eb17 100644 --- a/components/steps/style/small.ts +++ b/components/steps/style/small.ts @@ -31,14 +31,14 @@ const genStepsSmallStyle: GenerateStyle = (token) => { marginBottom: 0, marginInline: `0 ${unit(token.marginXS)}`, fontSize: fontSizeSM, - lineHeight: `${unit(iconSizeSM)}`, + lineHeight: unit(iconSizeSM), textAlign: 'center', borderRadius: iconSizeSM, }, [`${componentCls}-item-title`]: { paddingInlineEnd: token.paddingSM, fontSize, - lineHeight: `${unit(iconSizeSM)}`, + lineHeight: unit(iconSizeSM), '&::after': { top: token.calc(iconSizeSM).div(2).equal(), @@ -60,7 +60,7 @@ const genStepsSmallStyle: GenerateStyle = (token) => { borderRadius: 0, [`> ${componentCls}-icon`]: { fontSize: iconSizeSM, - lineHeight: `${unit(iconSizeSM)}`, + lineHeight: unit(iconSizeSM), transform: 'none', }, }, diff --git a/components/steps/style/vertical.ts b/components/steps/style/vertical.ts index ba6bbd328c..45655f1c4a 100644 --- a/components/steps/style/vertical.ts +++ b/components/steps/style/vertical.ts @@ -28,7 +28,7 @@ const genStepsVerticalStyle: GenerateStyle = (token) => { overflow: 'hidden', }, [`${componentCls}-item-title`]: { - lineHeight: `${unit(iconSize)}`, + lineHeight: unit(iconSize), }, [`${componentCls}-item-description`]: { paddingBottom: token.paddingSM, @@ -69,7 +69,7 @@ const genStepsVerticalStyle: GenerateStyle = (token) => { )}`, }, [`${componentCls}-item-title`]: { - lineHeight: `${unit(iconSizeSM)}`, + lineHeight: unit(iconSizeSM), }, }, }, diff --git a/components/style/roundedArrow.ts b/components/style/roundedArrow.ts index 7e0896c821..298b93060e 100644 --- a/components/style/roundedArrow.ts +++ b/components/style/roundedArrow.ts @@ -1,8 +1,9 @@ /* eslint-disable import/prefer-default-export */ import type { CSSObject } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs'; -import type { CSSUtil } from '../theme/internal'; + import type { AliasToken } from '../theme/interface'; +import type { CSSUtil } from '../theme/internal'; export interface ArrowToken { /** @internal */ diff --git a/components/switch/style/index.ts b/components/switch/style/index.ts index 6af3a71668..b722e91626 100644 --- a/components/switch/style/index.ts +++ b/components/switch/style/index.ts @@ -334,7 +334,7 @@ const genSwitchStyle = (token: SwitchToken): CSSObject => { boxSizing: 'border-box', minWidth: trackMinWidth, height: trackHeight, - lineHeight: `${unit(trackHeight)}`, + lineHeight: unit(trackHeight), verticalAlign: 'middle', background: token.colorTextQuaternary, border: '0', diff --git a/components/tree/style/index.ts b/components/tree/style/index.ts index 4fca6e0ebb..c2b17b32e8 100644 --- a/components/tree/style/index.ts +++ b/components/tree/style/index.ts @@ -197,7 +197,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => // https://github.com/ant-design/ant-design/issues/41915 flexShrink: 0, width: titleHeight, - lineHeight: `${unit(titleHeight)}`, + lineHeight: unit(titleHeight), textAlign: 'center', visibility: 'visible', opacity: 0.2, @@ -240,7 +240,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => alignSelf: 'stretch', width: titleHeight, margin: 0, - lineHeight: `${unit(titleHeight)}`, + lineHeight: unit(titleHeight), textAlign: 'center', cursor: 'pointer', userSelect: 'none', @@ -312,7 +312,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => margin: 0, padding: `0 ${unit(token.calc(token.paddingXS).div(2).equal())}`, color: 'inherit', - lineHeight: `${unit(titleHeight)}`, + lineHeight: unit(titleHeight), background: 'transparent', borderRadius: token.borderRadius, cursor: 'pointer', @@ -331,7 +331,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => display: 'inline-block', width: titleHeight, height: titleHeight, - lineHeight: `${unit(titleHeight)}`, + lineHeight: unit(titleHeight), textAlign: 'center', verticalAlign: 'top', @@ -348,7 +348,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject => // ==================== Draggable ===================== [`${treeCls}-node-content-wrapper`]: { - lineHeight: `${unit(titleHeight)}`, + lineHeight: unit(titleHeight), userSelect: 'none', ...getDropIndicatorStyle(prefixCls, token),