ant-design/components/steps/style/small.ts
MadCcc a434ec7614
refactor: Steps full token (#35841)
* refactor: steps full token

* refactor: progress dot

* refactor: no hard code

* refactor: token optimization
2022-06-01 11:19:05 +08:00

69 lines
1.9 KiB
TypeScript

import type { CSSObject } from '@ant-design/cssinjs';
import type { StepsToken } from '.';
import type { GenerateStyle } from '../../_util/theme';
const genStepsSmallStyle: GenerateStyle<StepsToken, CSSObject> = token => {
const {
componentCls,
stepsSmallIconSize,
// stepsSmallIconMargin,
fontSizeSM,
fontSizeBase,
colorTextSecondary,
} = token;
return {
[`&${componentCls}-small`]: {
[`&${componentCls}-horizontal:not(${componentCls}-label-vertical) ${componentCls}-item`]: {
paddingInlineStart: token.paddingSM,
'&:first-child': {
paddingInlineStart: 0,
},
},
[`${componentCls}-item-icon`]: {
width: stepsSmallIconSize,
height: stepsSmallIconSize,
// margin: stepsSmallIconMargin,
marginTop: 0,
marginBottom: 0,
marginInline: `0 ${token.marginXS}px`,
fontSize: fontSizeSM,
lineHeight: `${stepsSmallIconSize}px`,
textAlign: 'center',
borderRadius: stepsSmallIconSize,
},
[`${componentCls}-item-title`]: {
paddingInlineEnd: token.paddingSM,
fontSize: fontSizeBase,
lineHeight: `${stepsSmallIconSize}px`,
'&::after': {
top: stepsSmallIconSize / 2,
},
},
[`${componentCls}-item-description`]: {
color: colorTextSecondary,
fontSize: fontSizeBase,
},
[`${componentCls}-item-tail`]: {
top: token.marginXS,
},
[`${componentCls}-item-custom ${componentCls}-item-icon`]: {
width: 'inherit',
height: 'inherit',
lineHeight: 'inherit',
background: 'none',
border: 0,
borderRadius: 0,
[`> ${componentCls}-icon`]: {
fontSize: stepsSmallIconSize,
lineHeight: `${stepsSmallIconSize}px`,
transform: 'none',
},
},
},
};
};
export default genStepsSmallStyle;