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) => {
|
2023-05-09 19:24:50 +08:00
|
|
|
const { componentCls, iconSize, lineHeight, iconSizeSM } = token;
|
2022-04-19 11:28:06 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
[`&${componentCls}-label-vertical`]: {
|
|
|
|
[`${componentCls}-item`]: {
|
|
|
|
overflow: 'visible',
|
|
|
|
|
|
|
|
'&-tail': {
|
2023-05-09 19:24:50 +08:00
|
|
|
marginInlineStart: iconSize / 2 + token.controlHeightLG,
|
2022-06-01 11:19:05 +08:00
|
|
|
padding: `${token.paddingXXS}px ${token.paddingLG}px`,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'&-content': {
|
|
|
|
display: 'block',
|
2023-05-09 19:24:50 +08:00
|
|
|
width: (iconSize / 2 + token.controlHeightLG) * 2,
|
2022-06-01 11:19:05 +08:00
|
|
|
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': {
|
2023-05-09 19:24:50 +08:00
|
|
|
marginInlineStart: token.controlHeightLG + (iconSize - iconSizeSM) / 2,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export default genStepsLabelPlacementStyle;
|