2022-04-19 11:28:06 +08:00
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
|
|
import type { StepsToken } from '.';
|
2022-11-23 20:22:38 +08:00
|
|
|
import type { GenerateStyle } from '../../theme/internal';
|
2022-04-19 11:28:06 +08:00
|
|
|
|
2022-11-19 13:47:33 +08:00
|
|
|
const genStepsLabelPlacementStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
2022-06-01 11:19:05 +08:00
|
|
|
const { componentCls, stepsIconSize, lineHeight, stepsSmallIconSize } = token;
|
2022-04-19 11:28:06 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
[`&${componentCls}-label-vertical`]: {
|
|
|
|
[`${componentCls}-item`]: {
|
|
|
|
overflow: 'visible',
|
|
|
|
|
|
|
|
'&-tail': {
|
2022-06-01 11:19:05 +08:00
|
|
|
marginInlineStart: stepsIconSize / 2 + token.controlHeightLG,
|
|
|
|
padding: `${token.paddingXXS}px ${token.paddingLG}px`,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'&-content': {
|
|
|
|
display: 'block',
|
2022-06-01 11:19:05 +08:00
|
|
|
width: (stepsIconSize / 2 + token.controlHeightLG) * 2,
|
|
|
|
marginTop: token.marginSM,
|
2022-04-19 11:28:06 +08:00
|
|
|
textAlign: 'center',
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-icon': {
|
|
|
|
display: 'inline-block',
|
2022-06-01 11:19:05 +08:00
|
|
|
marginInlineStart: token.controlHeightLG,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'&-title': {
|
2022-06-01 11:19:05 +08:00
|
|
|
paddingInlineEnd: 0,
|
|
|
|
paddingInlineStart: 0,
|
2022-04-19 11:28:06 +08:00
|
|
|
|
|
|
|
'&::after': {
|
|
|
|
display: 'none',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-subtitle': {
|
|
|
|
display: 'block',
|
2022-06-01 11:19:05 +08:00
|
|
|
marginBottom: token.marginXXS,
|
|
|
|
marginInlineStart: 0,
|
2022-04-19 11:28:06 +08:00
|
|
|
lineHeight,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
[`&${componentCls}-small:not(${componentCls}-dot)`]: {
|
|
|
|
[`${componentCls}-item`]: {
|
|
|
|
'&-icon': {
|
2022-06-01 11:19:05 +08:00
|
|
|
marginInlineStart: token.controlHeightLG + (stepsIconSize - stepsSmallIconSize) / 2,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export default genStepsLabelPlacementStyle;
|