mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 00:09:39 +08:00
a434ec7614
* refactor: steps full token * refactor: progress dot * refactor: no hard code * refactor: token optimization
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import type { CSSObject } from '@ant-design/cssinjs';
|
|
import type { StepsToken } from '.';
|
|
import type { GenerateStyle } from '../../_util/theme';
|
|
|
|
const genStepsProgressStyle: GenerateStyle<StepsToken, CSSObject> = token => {
|
|
const { antCls, componentCls } = token;
|
|
|
|
return {
|
|
[`&${componentCls}-with-progress`]: {
|
|
[`${componentCls}-item`]: {
|
|
paddingTop: token.paddingXXS,
|
|
|
|
[`${componentCls}-item-tail`]: {
|
|
top: `${token.marginXXS}px !important`,
|
|
},
|
|
},
|
|
|
|
[`&${componentCls}-horizontal ${componentCls}-item:first-child`]: {
|
|
paddingBottom: token.paddingXXS,
|
|
paddingInlineStart: token.paddingXXS,
|
|
},
|
|
|
|
[`${componentCls}-item-icon`]: {
|
|
position: 'relative',
|
|
|
|
[`${antCls}-progress`]: {
|
|
position: 'absolute',
|
|
insetBlockStart:
|
|
(token.stepsIconSize - token.stepsProgressSize - token.lineWidth * 2) / 2,
|
|
insetInlineStart:
|
|
(token.stepsIconSize - token.stepsProgressSize - token.lineWidth * 2) / 2,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
export default genStepsProgressStyle;
|