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 genStepsSmallStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
2022-04-19 11:28:06 +08:00
|
|
|
const {
|
|
|
|
componentCls,
|
2023-05-09 19:24:50 +08:00
|
|
|
iconSizeSM,
|
2022-04-19 11:28:06 +08:00
|
|
|
// stepsSmallIconMargin,
|
|
|
|
fontSizeSM,
|
2022-11-01 15:06:38 +08:00
|
|
|
fontSize,
|
2022-08-04 16:16:50 +08:00
|
|
|
colorTextDescription,
|
2022-04-19 11:28:06 +08:00
|
|
|
} = token;
|
|
|
|
|
|
|
|
return {
|
|
|
|
[`&${componentCls}-small`]: {
|
|
|
|
[`&${componentCls}-horizontal:not(${componentCls}-label-vertical) ${componentCls}-item`]: {
|
2022-06-01 11:19:05 +08:00
|
|
|
paddingInlineStart: token.paddingSM,
|
2022-04-19 11:28:06 +08:00
|
|
|
'&:first-child': {
|
2022-06-01 11:19:05 +08:00
|
|
|
paddingInlineStart: 0,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-item-icon`]: {
|
2023-05-09 19:24:50 +08:00
|
|
|
width: iconSizeSM,
|
|
|
|
height: iconSizeSM,
|
2022-04-19 11:28:06 +08:00
|
|
|
// margin: stepsSmallIconMargin,
|
2022-06-01 11:19:05 +08:00
|
|
|
marginTop: 0,
|
|
|
|
marginBottom: 0,
|
|
|
|
marginInline: `0 ${token.marginXS}px`,
|
2022-04-19 11:28:06 +08:00
|
|
|
fontSize: fontSizeSM,
|
2023-05-09 19:24:50 +08:00
|
|
|
lineHeight: `${iconSizeSM}px`,
|
2022-04-19 11:28:06 +08:00
|
|
|
textAlign: 'center',
|
2023-05-09 19:24:50 +08:00
|
|
|
borderRadius: iconSizeSM,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
[`${componentCls}-item-title`]: {
|
2022-06-01 11:19:05 +08:00
|
|
|
paddingInlineEnd: token.paddingSM,
|
2022-11-01 15:06:38 +08:00
|
|
|
fontSize,
|
2023-05-09 19:24:50 +08:00
|
|
|
lineHeight: `${iconSizeSM}px`,
|
2022-04-19 11:28:06 +08:00
|
|
|
|
|
|
|
'&::after': {
|
2023-05-09 19:24:50 +08:00
|
|
|
top: iconSizeSM / 2,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
[`${componentCls}-item-description`]: {
|
2022-08-04 16:16:50 +08:00
|
|
|
color: colorTextDescription,
|
2022-11-01 15:06:38 +08:00
|
|
|
fontSize,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
[`${componentCls}-item-tail`]: {
|
2023-05-09 19:24:50 +08:00
|
|
|
top: iconSizeSM / 2 - token.paddingXXS,
|
2022-04-19 11:28:06 +08:00
|
|
|
},
|
|
|
|
[`${componentCls}-item-custom ${componentCls}-item-icon`]: {
|
|
|
|
width: 'inherit',
|
|
|
|
height: 'inherit',
|
|
|
|
lineHeight: 'inherit',
|
|
|
|
background: 'none',
|
2022-06-01 11:19:05 +08:00
|
|
|
border: 0,
|
|
|
|
borderRadius: 0,
|
2022-04-19 11:28:06 +08:00
|
|
|
[`> ${componentCls}-icon`]: {
|
2023-05-09 19:24:50 +08:00
|
|
|
fontSize: iconSizeSM,
|
|
|
|
lineHeight: `${iconSizeSM}px`,
|
2022-04-19 11:28:06 +08:00
|
|
|
transform: 'none',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export default genStepsSmallStyle;
|