ant-design/components/steps/style/progress.ts
MadCcc 34af3ec550
feat: component token rename (#42184)
* feat: component token naming rules

* dcos: update

* feat: modal token rename

* feat: rename result token

* feat: statsitic token rename

* feat: steps token remane

* chore: update snapshot

* chore: fix lint

* feat: semantic part component

* revert: button & notification

* revert: files

* chore: code clean
2023-05-09 19:24:50 +08:00

59 lines
1.9 KiB
TypeScript

import type { CSSObject } from '@ant-design/cssinjs';
import type { StepsToken } from '.';
import type { GenerateStyle } from '../../theme/internal';
const genStepsProgressStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
const { antCls, componentCls } = token;
return {
[`&${componentCls}-with-progress`]: {
[`${componentCls}-item`]: {
paddingTop: token.paddingXXS,
[`&-process ${componentCls}-item-container ${componentCls}-item-icon ${componentCls}-icon`]:
{
color: token.processIconColor,
},
},
[`&${componentCls}-vertical > ${componentCls}-item `]: {
paddingInlineStart: token.paddingXXS,
[`> ${componentCls}-item-container > ${componentCls}-item-tail`]: {
top: token.marginXXS,
insetInlineStart: token.iconSize / 2 - token.lineWidth + token.paddingXXS,
},
},
[`&, &${componentCls}-small`]: {
[`&${componentCls}-horizontal ${componentCls}-item:first-child`]: {
paddingBottom: token.paddingXXS,
paddingInlineStart: token.paddingXXS,
},
},
[`&${componentCls}-small${componentCls}-vertical > ${componentCls}-item > ${componentCls}-item-container > ${componentCls}-item-tail`]:
{
insetInlineStart: token.iconSizeSM / 2 - token.lineWidth + token.paddingXXS,
},
[`&${componentCls}-label-vertical`]: {
[`${componentCls}-item ${componentCls}-item-tail`]: {
top: token.margin - 2 * token.lineWidth,
},
},
[`${componentCls}-item-icon`]: {
position: 'relative',
[`${antCls}-progress`]: {
position: 'absolute',
insetBlockStart: (token.iconSize - token.stepsProgressSize - token.lineWidth * 2) / 2,
insetInlineStart: (token.iconSize - token.stepsProgressSize - token.lineWidth * 2) / 2,
},
},
},
};
};
export default genStepsProgressStyle;