2024-04-08 14:04:08 +08:00
|
|
|
import { unit } from '@ant-design/cssinjs';
|
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
|
|
|
2022-04-19 11:28:06 +08:00
|
|
|
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-11-17 15:33:28 +08:00
|
|
|
marginInlineStart: token.calc(iconSize).div(2).add(token.controlHeightLG).equal(),
|
2024-04-08 15:53:45 +08:00
|
|
|
padding: `0 ${unit(token.paddingLG)}`,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'&-content': {
|
|
|
|
display: 'block',
|
2023-11-17 15:33:28 +08:00
|
|
|
width: token.calc(iconSize).div(2).add(token.controlHeightLG).mul(2).equal(),
|
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-11-17 15:33:28 +08:00
|
|
|
marginInlineStart: token
|
|
|
|
.calc(iconSize)
|
|
|
|
.sub(iconSizeSM)
|
|
|
|
.div(2)
|
|
|
|
.add(token.controlHeightLG)
|
|
|
|
.equal(),
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export default genStepsLabelPlacementStyle;
|