mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 17:19:11 +08:00
3871763950
* feat: steps support cssVars * fix: fix style * Update check-cssinjs.tsx * fix: fix bug * style: code format * fix: fix bug * refactor: wireframe & tailTop * wip: fix taiTop * fix: remove tailTop and use token calc top fix: remove tailTop and use token calc top perf: add annotation --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: lijianan <574980606@qq.com>
62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
import { unit, 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: `${unit(token.paddingXXS)} ${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;
|