mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
chore: update unit value (#50258)
This commit is contained in:
parent
f77f5aef3d
commit
ddcdb2a6a2
@ -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': {
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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<ModalToken> = (token) => {
|
||||
display: 'flex',
|
||||
fontSize: token.fontSizeLG,
|
||||
fontStyle: 'normal',
|
||||
lineHeight: `${unit(token.modalCloseBtnSize)}`,
|
||||
lineHeight: unit(token.modalCloseBtnSize),
|
||||
justifyContent: 'center',
|
||||
textTransform: 'none',
|
||||
textRendering: 'auto',
|
||||
|
@ -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<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',
|
||||
|
@ -18,7 +18,7 @@ const genStepsCustomIconStyle: GenerateStyle<StepsToken, CSSObject> = (token) =>
|
||||
width: customIconSize,
|
||||
height: customIconSize,
|
||||
fontSize: customIconFontSize,
|
||||
lineHeight: `${unit(customIconSize)}`,
|
||||
lineHeight: unit(customIconSize),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -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`,
|
||||
@ -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',
|
||||
|
@ -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,
|
||||
|
||||
@ -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)
|
||||
|
@ -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(),
|
||||
@ -60,7 +60,7 @@ const genStepsSmallStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
||||
borderRadius: 0,
|
||||
[`> ${componentCls}-icon`]: {
|
||||
fontSize: iconSizeSM,
|
||||
lineHeight: `${unit(iconSizeSM)}`,
|
||||
lineHeight: unit(iconSizeSM),
|
||||
transform: 'none',
|
||||
},
|
||||
},
|
||||
|
@ -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,
|
||||
@ -69,7 +69,7 @@ const genStepsVerticalStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
||||
)}`,
|
||||
},
|
||||
[`${componentCls}-item-title`]: {
|
||||
lineHeight: `${unit(iconSizeSM)}`,
|
||||
lineHeight: unit(iconSizeSM),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -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 */
|
||||
|
@ -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',
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user