Skip to content

Commit

Permalink
chore: update unit value (ant-design#50258)
Browse files Browse the repository at this point in the history
  • Loading branch information
li-jia-nan authored and linxianxi committed Aug 14, 2024
1 parent a572385 commit 711ff81
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions components/calendar/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`]: {
Expand All @@ -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),
},
},
},
Expand Down Expand Up @@ -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': {
Expand Down
2 changes: 1 addition & 1 deletion components/color-picker/style/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const genInputStyle: GenerateStyle<ColorPickerToken, CSSObject> = (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,
Expand Down
3 changes: 1 addition & 2 deletions components/color-picker/style/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ const genSliderStyle: GenerateStyle<ColorPickerToken, CSSObject> = (token) => {
return {
// ======================== Slider ========================
[`${componentCls}-slider`]: [
getTransBg(`${unit(colorPickerSliderHeight)}`, token.colorFillSecondary),

getTransBg(unit(colorPickerSliderHeight), token.colorFillSecondary),
{
margin: 0,
padding: 0,
Expand Down
4 changes: 2 additions & 2 deletions components/modal/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import type {
AliasToken,
FullToken,
GenerateStyle,
GlobalToken,
GenStyleFn,
GlobalToken,
TokenWithCommonCls,
} from '../../theme/internal';
import { genStyleHooks, mergeToken } from '../../theme/internal';
Expand Down Expand Up @@ -242,7 +242,7 @@ const genModalStyle: GenerateStyle<ModalToken> = (token) => {
display: 'flex',
fontSize: token.fontSizeLG,
fontStyle: 'normal',
lineHeight: `${unit(token.modalCloseBtnSize)}`,
lineHeight: unit(token.modalCloseBtnSize),
justifyContent: 'center',
textTransform: 'none',
textRendering: 'auto',
Expand Down
4 changes: 2 additions & 2 deletions components/pagination/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -400,7 +400,7 @@ const genPaginationJumpStyle: GenerateStyle<PaginationToken, CSSObject> = (token
height: token.itemSize,
color: token.colorText,
fontFamily: token.fontFamily,
lineHeight: `${unit(token.itemSize)}`,
lineHeight: unit(token.itemSize),
textAlign: 'center',
verticalAlign: 'middle',
listStyle: 'none',
Expand Down
2 changes: 1 addition & 1 deletion components/steps/style/custom-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const genStepsCustomIconStyle: GenerateStyle<StepsToken, CSSObject> = (token) =>
width: customIconSize,
height: customIconSize,
fontSize: customIconFontSize,
lineHeight: `${unit(customIconSize)}`,
lineHeight: unit(customIconSize),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions components/steps/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const genStepsItemStyle: GenerateStyle<StepsToken, CSSObject> = (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`,
Expand Down Expand Up @@ -266,7 +266,7 @@ const genStepsItemStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
paddingInlineEnd: token.padding,
color: token.colorText,
fontSize: token.fontSizeLG,
lineHeight: `${unit(token.titleLineHeight)}`,
lineHeight: unit(token.titleLineHeight),

'&::after': {
position: 'absolute',
Expand Down
4 changes: 2 additions & 2 deletions components/steps/style/progress-dot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const genStepsProgressDotStyle: GenerateStyle<StepsToken, CSSObject> = (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,

Expand Down Expand Up @@ -82,7 +82,7 @@ const genStepsProgressDotStyle: GenerateStyle<StepsToken, CSSObject> = (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)
Expand Down
6 changes: 3 additions & 3 deletions components/steps/style/small.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ const genStepsSmallStyle: GenerateStyle<StepsToken, CSSObject> = (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(),
Expand All @@ -60,7 +60,7 @@ const genStepsSmallStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
borderRadius: 0,
[`> ${componentCls}-icon`]: {
fontSize: iconSizeSM,
lineHeight: `${unit(iconSizeSM)}`,
lineHeight: unit(iconSizeSM),
transform: 'none',
},
},
Expand Down
4 changes: 2 additions & 2 deletions components/steps/style/vertical.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const genStepsVerticalStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
overflow: 'hidden',
},
[`${componentCls}-item-title`]: {
lineHeight: `${unit(iconSize)}`,
lineHeight: unit(iconSize),
},
[`${componentCls}-item-description`]: {
paddingBottom: token.paddingSM,
Expand Down Expand Up @@ -69,7 +69,7 @@ const genStepsVerticalStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
)}`,
},
[`${componentCls}-item-title`]: {
lineHeight: `${unit(iconSizeSM)}`,
lineHeight: unit(iconSizeSM),
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion components/style/roundedArrow.ts
Original file line number Diff line number Diff line change
@@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion components/switch/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
10 changes: 5 additions & 5 deletions components/tree/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',

Expand All @@ -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),
Expand Down

0 comments on commit 711ff81

Please sign in to comment.