chore: update unit value (#50258)

pull/50259/head
lijianan 6 months ago committed by GitHub
parent f77f5aef3d
commit ddcdb2a6a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -107,7 +107,7 @@ export const genCalendarStyles = (token: CalendarToken): CSSObject => {
th: { th: {
height: 'auto', height: 'auto',
padding: 0, padding: 0,
lineHeight: `${unit(token.weekHeight)}`, lineHeight: unit(token.weekHeight),
}, },
}, },
[`${componentCls}-cell::before`]: { [`${componentCls}-cell::before`]: {
@ -129,7 +129,7 @@ export const genCalendarStyles = (token: CalendarToken): CSSObject => {
height: 'auto', height: 'auto',
paddingInlineEnd: token.paddingSM, paddingInlineEnd: token.paddingSM,
paddingBottom: token.paddingXXS, paddingBottom: token.paddingXXS,
lineHeight: `${unit(token.weekHeight)}`, lineHeight: unit(token.weekHeight),
}, },
}, },
}, },
@ -170,7 +170,7 @@ export const genCalendarStyles = (token: CalendarToken): CSSObject => {
borderRadius: 0, borderRadius: 0,
transition: `background ${token.motionDurationSlow}`, transition: `background ${token.motionDurationSlow}`,
'&-value': { '&-value': {
lineHeight: `${unit(token.dateValueHeight)}`, lineHeight: unit(token.dateValueHeight),
transition: `color ${token.motionDurationSlow}`, transition: `color ${token.motionDurationSlow}`,
}, },
'&-content': { '&-content': {

@ -56,7 +56,7 @@ const genInputStyle: GenerateStyle<ColorPickerToken, CSSObject> = (token) => {
[`${antCls}-select-selection-item`]: { [`${antCls}-select-selection-item`]: {
paddingInlineEnd: token.calc(fontSizeIcon).add(marginXXS).equal(), paddingInlineEnd: token.calc(fontSizeIcon).add(marginXXS).equal(),
fontSize: fontSizeSM, fontSize: fontSizeSM,
lineHeight: `${unit(controlHeightSM)}`, lineHeight: unit(controlHeightSM),
}, },
[`${antCls}-select-item-option-content`]: { [`${antCls}-select-item-option-content`]: {
fontSize: fontSizeSM, fontSize: fontSizeSM,

@ -38,8 +38,7 @@ const genSliderStyle: GenerateStyle<ColorPickerToken, CSSObject> = (token) => {
return { return {
// ======================== Slider ======================== // ======================== Slider ========================
[`${componentCls}-slider`]: [ [`${componentCls}-slider`]: [
getTransBg(`${unit(colorPickerSliderHeight)}`, token.colorFillSecondary), getTransBg(unit(colorPickerSliderHeight), token.colorFillSecondary),
{ {
margin: 0, margin: 0,
padding: 0, padding: 0,

@ -7,8 +7,8 @@ import type {
AliasToken, AliasToken,
FullToken, FullToken,
GenerateStyle, GenerateStyle,
GlobalToken,
GenStyleFn, GenStyleFn,
GlobalToken,
TokenWithCommonCls, TokenWithCommonCls,
} from '../../theme/internal'; } from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal'; import { genStyleHooks, mergeToken } from '../../theme/internal';
@ -242,7 +242,7 @@ const genModalStyle: GenerateStyle<ModalToken> = (token) => {
display: 'flex', display: 'flex',
fontSize: token.fontSizeLG, fontSize: token.fontSizeLG,
fontStyle: 'normal', fontStyle: 'normal',
lineHeight: `${unit(token.modalCloseBtnSize)}`, lineHeight: unit(token.modalCloseBtnSize),
justifyContent: 'center', justifyContent: 'center',
textTransform: 'none', textTransform: 'none',
textRendering: 'auto', textRendering: 'auto',

@ -10,7 +10,7 @@ import {
import type { SharedComponentToken, SharedInputToken } from '../../input/style/token'; import type { SharedComponentToken, SharedInputToken } from '../../input/style/token';
import { genBaseOutlinedStyle, genDisabledStyle } from '../../input/style/variants'; import { genBaseOutlinedStyle, genDisabledStyle } from '../../input/style/variants';
import { genFocusOutline, genFocusStyle, resetComponent } from '../../style'; 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'; import { genStyleHooks, mergeToken } from '../../theme/internal';
export interface ComponentToken { export interface ComponentToken {
@ -400,7 +400,7 @@ const genPaginationJumpStyle: GenerateStyle<PaginationToken, CSSObject> = (token
height: token.itemSize, height: token.itemSize,
color: token.colorText, color: token.colorText,
fontFamily: token.fontFamily, fontFamily: token.fontFamily,
lineHeight: `${unit(token.itemSize)}`, lineHeight: unit(token.itemSize),
textAlign: 'center', textAlign: 'center',
verticalAlign: 'middle', verticalAlign: 'middle',
listStyle: 'none', listStyle: 'none',

@ -18,7 +18,7 @@ const genStepsCustomIconStyle: GenerateStyle<StepsToken, CSSObject> = (token) =>
width: customIconSize, width: customIconSize,
height: customIconSize, height: customIconSize,
fontSize: customIconFontSize, fontSize: customIconFontSize,
lineHeight: `${unit(customIconSize)}`, lineHeight: unit(customIconSize),
}, },
}, },
}, },

@ -232,7 +232,7 @@ const genStepsItemStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
marginInlineEnd: token.marginXS, marginInlineEnd: token.marginXS,
fontSize: token.iconFontSize, fontSize: token.iconFontSize,
fontFamily: token.fontFamily, fontFamily: token.fontFamily,
lineHeight: `${unit(token.iconSize)}`, lineHeight: unit(token.iconSize),
textAlign: 'center', textAlign: 'center',
borderRadius: token.iconSize, borderRadius: token.iconSize,
border: `${unit(token.lineWidth)} ${token.lineType} transparent`, border: `${unit(token.lineWidth)} ${token.lineType} transparent`,
@ -266,7 +266,7 @@ const genStepsItemStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
paddingInlineEnd: token.padding, paddingInlineEnd: token.padding,
color: token.colorText, color: token.colorText,
fontSize: token.fontSizeLG, fontSize: token.fontSizeLG,
lineHeight: `${unit(token.titleLineHeight)}`, lineHeight: unit(token.titleLineHeight),
'&::after': { '&::after': {
position: 'absolute', position: 'absolute',

@ -45,7 +45,7 @@ const genStepsProgressDotStyle: GenerateStyle<StepsToken, CSSObject> = (token) =
height: dotSize, height: dotSize,
marginInlineStart: token.calc(token.descriptionMaxWidth).sub(dotSize).div(2).equal(), marginInlineStart: token.calc(token.descriptionMaxWidth).sub(dotSize).div(2).equal(),
paddingInlineEnd: 0, paddingInlineEnd: 0,
lineHeight: `${unit(dotSize)}`, lineHeight: unit(dotSize),
background: 'transparent', background: 'transparent',
border: 0, border: 0,
@ -82,7 +82,7 @@ const genStepsProgressDotStyle: GenerateStyle<StepsToken, CSSObject> = (token) =
top: token.calc(dotSize).sub(dotCurrentSize).div(2).equal(), top: token.calc(dotSize).sub(dotCurrentSize).div(2).equal(),
width: dotCurrentSize, width: dotCurrentSize,
height: dotCurrentSize, height: dotCurrentSize,
lineHeight: `${unit(dotCurrentSize)}`, lineHeight: unit(dotCurrentSize),
background: 'none', background: 'none',
marginInlineStart: token marginInlineStart: token
.calc(token.descriptionMaxWidth) .calc(token.descriptionMaxWidth)

@ -31,14 +31,14 @@ const genStepsSmallStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
marginBottom: 0, marginBottom: 0,
marginInline: `0 ${unit(token.marginXS)}`, marginInline: `0 ${unit(token.marginXS)}`,
fontSize: fontSizeSM, fontSize: fontSizeSM,
lineHeight: `${unit(iconSizeSM)}`, lineHeight: unit(iconSizeSM),
textAlign: 'center', textAlign: 'center',
borderRadius: iconSizeSM, borderRadius: iconSizeSM,
}, },
[`${componentCls}-item-title`]: { [`${componentCls}-item-title`]: {
paddingInlineEnd: token.paddingSM, paddingInlineEnd: token.paddingSM,
fontSize, fontSize,
lineHeight: `${unit(iconSizeSM)}`, lineHeight: unit(iconSizeSM),
'&::after': { '&::after': {
top: token.calc(iconSizeSM).div(2).equal(), top: token.calc(iconSizeSM).div(2).equal(),
@ -60,7 +60,7 @@ const genStepsSmallStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
borderRadius: 0, borderRadius: 0,
[`> ${componentCls}-icon`]: { [`> ${componentCls}-icon`]: {
fontSize: iconSizeSM, fontSize: iconSizeSM,
lineHeight: `${unit(iconSizeSM)}`, lineHeight: unit(iconSizeSM),
transform: 'none', transform: 'none',
}, },
}, },

@ -28,7 +28,7 @@ const genStepsVerticalStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
overflow: 'hidden', overflow: 'hidden',
}, },
[`${componentCls}-item-title`]: { [`${componentCls}-item-title`]: {
lineHeight: `${unit(iconSize)}`, lineHeight: unit(iconSize),
}, },
[`${componentCls}-item-description`]: { [`${componentCls}-item-description`]: {
paddingBottom: token.paddingSM, paddingBottom: token.paddingSM,
@ -69,7 +69,7 @@ const genStepsVerticalStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
)}`, )}`,
}, },
[`${componentCls}-item-title`]: { [`${componentCls}-item-title`]: {
lineHeight: `${unit(iconSizeSM)}`, lineHeight: unit(iconSizeSM),
}, },
}, },
}, },

@ -1,8 +1,9 @@
/* eslint-disable import/prefer-default-export */ /* eslint-disable import/prefer-default-export */
import type { CSSObject } from '@ant-design/cssinjs'; import type { CSSObject } from '@ant-design/cssinjs';
import { unit } from '@ant-design/cssinjs'; import { unit } from '@ant-design/cssinjs';
import type { CSSUtil } from '../theme/internal';
import type { AliasToken } from '../theme/interface'; import type { AliasToken } from '../theme/interface';
import type { CSSUtil } from '../theme/internal';
export interface ArrowToken { export interface ArrowToken {
/** @internal */ /** @internal */

@ -334,7 +334,7 @@ const genSwitchStyle = (token: SwitchToken): CSSObject => {
boxSizing: 'border-box', boxSizing: 'border-box',
minWidth: trackMinWidth, minWidth: trackMinWidth,
height: trackHeight, height: trackHeight,
lineHeight: `${unit(trackHeight)}`, lineHeight: unit(trackHeight),
verticalAlign: 'middle', verticalAlign: 'middle',
background: token.colorTextQuaternary, background: token.colorTextQuaternary,
border: '0', border: '0',

@ -197,7 +197,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
// https://github.com/ant-design/ant-design/issues/41915 // https://github.com/ant-design/ant-design/issues/41915
flexShrink: 0, flexShrink: 0,
width: titleHeight, width: titleHeight,
lineHeight: `${unit(titleHeight)}`, lineHeight: unit(titleHeight),
textAlign: 'center', textAlign: 'center',
visibility: 'visible', visibility: 'visible',
opacity: 0.2, opacity: 0.2,
@ -240,7 +240,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
alignSelf: 'stretch', alignSelf: 'stretch',
width: titleHeight, width: titleHeight,
margin: 0, margin: 0,
lineHeight: `${unit(titleHeight)}`, lineHeight: unit(titleHeight),
textAlign: 'center', textAlign: 'center',
cursor: 'pointer', cursor: 'pointer',
userSelect: 'none', userSelect: 'none',
@ -312,7 +312,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
margin: 0, margin: 0,
padding: `0 ${unit(token.calc(token.paddingXS).div(2).equal())}`, padding: `0 ${unit(token.calc(token.paddingXS).div(2).equal())}`,
color: 'inherit', color: 'inherit',
lineHeight: `${unit(titleHeight)}`, lineHeight: unit(titleHeight),
background: 'transparent', background: 'transparent',
borderRadius: token.borderRadius, borderRadius: token.borderRadius,
cursor: 'pointer', cursor: 'pointer',
@ -331,7 +331,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
display: 'inline-block', display: 'inline-block',
width: titleHeight, width: titleHeight,
height: titleHeight, height: titleHeight,
lineHeight: `${unit(titleHeight)}`, lineHeight: unit(titleHeight),
textAlign: 'center', textAlign: 'center',
verticalAlign: 'top', verticalAlign: 'top',
@ -348,7 +348,7 @@ export const genBaseStyle = (prefixCls: string, token: TreeToken): CSSObject =>
// ==================== Draggable ===================== // ==================== Draggable =====================
[`${treeCls}-node-content-wrapper`]: { [`${treeCls}-node-content-wrapper`]: {
lineHeight: `${unit(titleHeight)}`, lineHeight: unit(titleHeight),
userSelect: 'none', userSelect: 'none',
...getDropIndicatorStyle(prefixCls, token), ...getDropIndicatorStyle(prefixCls, token),

Loading…
Cancel
Save