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 genStepsVerticalStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
2023-05-09 19:24:50 +08:00
|
|
|
const { componentCls, iconSizeSM, iconSize } = token;
|
2022-04-19 11:28:06 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
[`&${componentCls}-vertical`]: {
|
|
|
|
display: 'flex',
|
|
|
|
flexDirection: 'column',
|
|
|
|
|
|
|
|
[`> ${componentCls}-item`]: {
|
|
|
|
display: 'block',
|
|
|
|
flex: '1 0 auto',
|
2022-06-01 11:19:05 +08:00
|
|
|
paddingInlineStart: 0,
|
2022-04-19 11:28:06 +08:00
|
|
|
overflow: 'visible',
|
|
|
|
|
|
|
|
[`${componentCls}-item-icon`]: {
|
|
|
|
float: 'left',
|
2022-06-01 11:19:05 +08:00
|
|
|
marginInlineEnd: token.margin,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
[`${componentCls}-item-content`]: {
|
|
|
|
display: 'block',
|
2023-11-17 15:33:28 +08:00
|
|
|
minHeight: token.calc(token.controlHeight).mul(1.5).equal(),
|
2022-04-19 11:28:06 +08:00
|
|
|
overflow: 'hidden',
|
|
|
|
},
|
|
|
|
[`${componentCls}-item-title`]: {
|
2024-08-06 00:04:28 +08:00
|
|
|
lineHeight: unit(iconSize),
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
[`${componentCls}-item-description`]: {
|
2022-06-01 11:19:05 +08:00
|
|
|
paddingBottom: token.paddingSM,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
[`> ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]: {
|
|
|
|
position: 'absolute',
|
2022-06-01 11:19:05 +08:00
|
|
|
top: 0,
|
2023-11-17 15:33:28 +08:00
|
|
|
insetInlineStart: token.calc(iconSize).div(2).sub(token.lineWidth).equal(),
|
2022-06-01 11:19:05 +08:00
|
|
|
width: token.lineWidth,
|
|
|
|
height: '100%',
|
2023-11-17 15:33:28 +08:00
|
|
|
padding: `${unit(token.calc(token.marginXXS).mul(1.5).add(iconSize).equal())} 0 ${unit(
|
|
|
|
token.calc(token.marginXXS).mul(1.5).equal(),
|
|
|
|
)}`,
|
2022-04-19 11:28:06 +08:00
|
|
|
|
|
|
|
'&::after': {
|
2022-06-01 11:19:05 +08:00
|
|
|
width: token.lineWidth,
|
|
|
|
height: '100%',
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
[`> ${componentCls}-item:not(:last-child) > ${componentCls}-item-container > ${componentCls}-item-tail`]:
|
|
|
|
{
|
|
|
|
display: 'block',
|
|
|
|
},
|
|
|
|
[` > ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-content > ${componentCls}-item-title`]:
|
|
|
|
{
|
|
|
|
'&::after': {
|
|
|
|
display: 'none',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
[`&${componentCls}-small ${componentCls}-item-container`]: {
|
|
|
|
[`${componentCls}-item-tail`]: {
|
|
|
|
position: 'absolute',
|
2022-06-01 11:19:05 +08:00
|
|
|
top: 0,
|
2023-11-17 15:33:28 +08:00
|
|
|
insetInlineStart: token.calc(iconSizeSM).div(2).sub(token.lineWidth).equal(),
|
|
|
|
padding: `${unit(token.calc(token.marginXXS).mul(1.5).add(iconSizeSM).equal())} 0 ${unit(
|
|
|
|
token.calc(token.marginXXS).mul(1.5).equal(),
|
|
|
|
)}`,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
[`${componentCls}-item-title`]: {
|
2024-08-06 00:04:28 +08:00
|
|
|
lineHeight: unit(iconSizeSM),
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export default genStepsVerticalStyle;
|