mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 02:49:18 +08:00
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import type { CSSObject } from '@ant-design/cssinjs';
|
|
|
|
import type { StepsToken } from '.';
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
import { genCssVar } from '../../theme/util/genStyleUtils';
|
|
|
|
const genHorizontalStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
|
const { componentCls, antCls } = token;
|
|
const itemCls = `${componentCls}-item`;
|
|
const [varName, varRef] = genCssVar(antCls, 'cmp-steps');
|
|
return {
|
|
[`${componentCls}-horizontal`]: {
|
|
[`> ${itemCls}`]: {
|
|
flex: '1 1 auto',
|
|
minWidth: token.iconSize,
|
|
[`${itemCls}-rail`]: {
|
|
[varName('horizontal-rail-margin')]:
|
|
`calc(${varRef('icon-size-max')} / 2 + ${varRef('item-wrapper-padding-top')})`,
|
|
position: 'static',
|
|
marginTop: varRef('horizontal-rail-margin'),
|
|
width: 'auto',
|
|
borderBlockStartWidth: varRef('rail-size'),
|
|
flex: 1,
|
|
minWidth: 0,
|
|
alignSelf: 'flex-start',
|
|
transform: 'translateY(-50%)',
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
export default genHorizontalStyle;
|