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 genStepsProgressStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
2022-04-19 11:28:06 +08:00
|
|
|
const { antCls, componentCls } = token;
|
|
|
|
|
|
|
|
return {
|
|
|
|
[`&${componentCls}-with-progress`]: {
|
|
|
|
[`${componentCls}-item`]: {
|
2022-06-01 11:19:05 +08:00
|
|
|
paddingTop: token.paddingXXS,
|
2022-11-07 15:18:48 +08:00
|
|
|
|
|
|
|
[`&-process ${componentCls}-item-container ${componentCls}-item-icon ${componentCls}-icon`]:
|
|
|
|
{
|
|
|
|
color: token.processIconColor,
|
|
|
|
},
|
2022-11-01 15:06:38 +08:00
|
|
|
},
|
2022-04-19 11:28:06 +08:00
|
|
|
|
2022-12-01 10:57:48 +08:00
|
|
|
[`&${componentCls}-vertical > ${componentCls}-item `]: {
|
|
|
|
paddingInlineStart: token.paddingXXS,
|
|
|
|
[`> ${componentCls}-item-container > ${componentCls}-item-tail`]: {
|
2022-11-01 15:06:38 +08:00
|
|
|
top: token.marginXXS,
|
2023-11-17 15:33:28 +08:00
|
|
|
insetInlineStart: token
|
|
|
|
.calc(token.iconSize)
|
|
|
|
.div(2)
|
|
|
|
.sub(token.lineWidth)
|
|
|
|
.add(token.paddingXXS)
|
|
|
|
.equal(),
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
2022-12-01 10:57:48 +08:00
|
|
|
},
|
2022-04-19 11:28:06 +08:00
|
|
|
|
2022-12-01 10:57:48 +08:00
|
|
|
[`&, &${componentCls}-small`]: {
|
|
|
|
[`&${componentCls}-horizontal ${componentCls}-item:first-child`]: {
|
2022-08-15 15:20:39 +08:00
|
|
|
paddingBottom: token.paddingXXS,
|
|
|
|
paddingInlineStart: token.paddingXXS,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-12-01 10:57:48 +08:00
|
|
|
[`&${componentCls}-small${componentCls}-vertical > ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]:
|
|
|
|
{
|
2023-11-17 15:33:28 +08:00
|
|
|
insetInlineStart: token
|
|
|
|
.calc(token.iconSizeSM)
|
|
|
|
.div(2)
|
|
|
|
.sub(token.lineWidth)
|
|
|
|
.add(token.paddingXXS)
|
|
|
|
.equal(),
|
2022-12-01 10:57:48 +08:00
|
|
|
},
|
|
|
|
|
2022-08-15 15:20:39 +08:00
|
|
|
[`&${componentCls}-label-vertical`]: {
|
|
|
|
[`${componentCls}-item ${componentCls}-item-tail`]: {
|
2023-11-17 15:33:28 +08:00
|
|
|
top: token.calc(token.margin).sub(token.calc(token.lineWidth).mul(2).equal()).equal(),
|
2022-08-15 15:20:39 +08:00
|
|
|
},
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-item-icon`]: {
|
|
|
|
position: 'relative',
|
|
|
|
|
|
|
|
[`${antCls}-progress`]: {
|
|
|
|
position: 'absolute',
|
2023-11-17 15:33:28 +08:00
|
|
|
insetBlockStart: token
|
|
|
|
.calc(
|
|
|
|
token
|
|
|
|
.calc(token.iconSize)
|
|
|
|
.sub(token.stepsProgressSize)
|
|
|
|
.sub(token.calc(token.lineWidth).mul(2).equal())
|
|
|
|
.equal(),
|
|
|
|
)
|
|
|
|
.div(2)
|
|
|
|
.equal(),
|
|
|
|
insetInlineStart: token
|
|
|
|
.calc(
|
|
|
|
token
|
|
|
|
.calc(token.iconSize)
|
|
|
|
.sub(token.stepsProgressSize)
|
|
|
|
.sub(token.calc(token.lineWidth).mul(2).equal())
|
|
|
|
.equal(),
|
|
|
|
)
|
|
|
|
.div(2)
|
|
|
|
.equal(),
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default genStepsProgressStyle;
|