2022-04-19 11:28:06 +08:00
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
|
|
import type { StepsToken } from '.';
|
2022-06-27 14:25:59 +08:00
|
|
|
import type { GenerateStyle } from '../../theme';
|
2022-04-19 11:28:06 +08:00
|
|
|
|
|
|
|
const genStepsProgressStyle: GenerateStyle<StepsToken, CSSObject> = token => {
|
|
|
|
const { antCls, componentCls } = token;
|
|
|
|
|
|
|
|
return {
|
|
|
|
[`&${componentCls}-with-progress`]: {
|
|
|
|
[`${componentCls}-item`]: {
|
2022-06-01 11:19:05 +08:00
|
|
|
paddingTop: token.paddingXXS,
|
2022-11-01 15:06:38 +08:00
|
|
|
},
|
2022-04-19 11:28:06 +08:00
|
|
|
|
2022-11-01 15:06:38 +08:00
|
|
|
[`&${componentCls}-vertical > ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]:
|
|
|
|
{
|
|
|
|
top: token.marginXXS,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
|
2022-08-15 15:20:39 +08:00
|
|
|
[`&${componentCls}-horizontal`]: {
|
|
|
|
[`${componentCls}-item:first-child`]: {
|
|
|
|
paddingBottom: token.paddingXXS,
|
|
|
|
paddingInlineStart: token.paddingXXS,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
[`&${componentCls}-label-vertical`]: {
|
|
|
|
[`${componentCls}-item ${componentCls}-item-tail`]: {
|
|
|
|
top: token.margin - 2 * token.lineWidth,
|
|
|
|
},
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-item-icon`]: {
|
|
|
|
position: 'relative',
|
|
|
|
|
|
|
|
[`${antCls}-progress`]: {
|
|
|
|
position: 'absolute',
|
2022-09-13 11:52:56 +08:00
|
|
|
insetBlockStart:
|
|
|
|
(token.stepsIconSize - token.stepsProgressSize - token.lineWidth * 2) / 2,
|
|
|
|
insetInlineStart:
|
|
|
|
(token.stepsIconSize - token.stepsProgressSize - token.lineWidth * 2) / 2,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default genStepsProgressStyle;
|