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 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',
|
2022-06-01 11:19:05 +08:00
|
|
|
minHeight: token.controlHeight * 1.5,
|
2022-04-19 11:28:06 +08:00
|
|
|
overflow: 'hidden',
|
|
|
|
},
|
|
|
|
[`${componentCls}-item-title`]: {
|
2023-05-09 19:24:50 +08:00
|
|
|
lineHeight: `${iconSize}px`,
|
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-05-09 19:24:50 +08:00
|
|
|
insetInlineStart: iconSize / 2 - token.lineWidth,
|
2022-06-01 11:19:05 +08:00
|
|
|
width: token.lineWidth,
|
|
|
|
height: '100%',
|
2023-05-09 19:24:50 +08:00
|
|
|
padding: `${iconSize + token.marginXXS * 1.5}px 0 ${token.marginXXS * 1.5}px`,
|
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-05-09 19:24:50 +08:00
|
|
|
insetInlineStart: iconSizeSM / 2 - token.lineWidth,
|
|
|
|
padding: `${iconSizeSM + token.marginXXS * 1.5}px 0 ${token.marginXXS * 1.5}px`,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
[`${componentCls}-item-title`]: {
|
2023-05-09 19:24:50 +08:00
|
|
|
lineHeight: `${iconSizeSM}px`,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export default genStepsVerticalStyle;
|