mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-22 22:48:29 +08:00
8fc4fa06c8
* fix: use css var for calc * fix: tail align * Update components/steps/style/index.ts Co-authored-by: 红 <wxh1220@gmail.com> Signed-off-by: afc163 <afc163@gmail.com> * test: update snapshot * chore: fix lint * chore: adjust style --------- Signed-off-by: afc163 <afc163@gmail.com> Co-authored-by: afc163 <afc163@gmail.com> Co-authored-by: 红 <wxh1220@gmail.com>
64 lines
1.7 KiB
TypeScript
64 lines
1.7 KiB
TypeScript
import { unit } from '@ant-design/cssinjs';
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
|
|
|
import type { StepsToken } from '.';
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
|
|
const genStepsLabelPlacementStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
|
const { componentCls, iconSize, lineHeight, iconSizeSM } = token;
|
|
|
|
return {
|
|
[`&${componentCls}-label-vertical`]: {
|
|
[`${componentCls}-item`]: {
|
|
overflow: 'visible',
|
|
|
|
'&-tail': {
|
|
marginInlineStart: token.calc(iconSize).div(2).add(token.controlHeightLG).equal(),
|
|
padding: `0 ${unit(token.paddingLG)}`,
|
|
},
|
|
|
|
'&-content': {
|
|
display: 'block',
|
|
width: token.calc(iconSize).div(2).add(token.controlHeightLG).mul(2).equal(),
|
|
marginTop: token.marginSM,
|
|
textAlign: 'center',
|
|
},
|
|
|
|
'&-icon': {
|
|
display: 'inline-block',
|
|
marginInlineStart: token.controlHeightLG,
|
|
},
|
|
|
|
'&-title': {
|
|
paddingInlineEnd: 0,
|
|
paddingInlineStart: 0,
|
|
|
|
'&::after': {
|
|
display: 'none',
|
|
},
|
|
},
|
|
|
|
'&-subtitle': {
|
|
display: 'block',
|
|
marginBottom: token.marginXXS,
|
|
marginInlineStart: 0,
|
|
lineHeight,
|
|
},
|
|
},
|
|
[`&${componentCls}-small:not(${componentCls}-dot)`]: {
|
|
[`${componentCls}-item`]: {
|
|
'&-icon': {
|
|
marginInlineStart: token
|
|
.calc(iconSize)
|
|
.sub(iconSizeSM)
|
|
.div(2)
|
|
.add(token.controlHeightLG)
|
|
.equal(),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
export default genStepsLabelPlacementStyle;
|