You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
4.0 KiB

import type { CSSObject } from '@ant-design/cssinjs';
import { textEllipsis } from '../../style';
import type { StepsToken } from '.';
import type { GenerateStyle } from '../../theme/internal';
const genStepsNavStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
const {
componentCls,
stepsNavContentMaxWidth,
stepsNavArrowColor,
stepsNavActiveColor,
motionDurationSlow,
} = token;
return {
[`&${componentCls}-navigation`]: {
paddingTop: token.paddingSM,
[`&${componentCls}-small`]: {
[`${componentCls}-item`]: {
'&-container': {
marginInlineStart: -token.marginSM,
},
},
},
[`${componentCls}-item`]: {
overflow: 'visible',
textAlign: 'center',
'&-container': {
display: 'inline-block',
height: '100%',
marginInlineStart: -token.margin,
paddingBottom: token.paddingSM,
textAlign: 'start',
transition: `opacity ${motionDurationSlow}`,
[`${componentCls}-item-content`]: {
maxWidth: stepsNavContentMaxWidth,
},
[`${componentCls}-item-title`]: {
maxWidth: '100%',
paddingInlineEnd: 0,
...textEllipsis,
'&::after': {
display: 'none',
},
},
},
[`&:not(${componentCls}-item-active)`]: {
[`${componentCls}-item-container[role='button']`]: {
cursor: 'pointer',
'&:hover': {
opacity: 0.85,
},
},
},
'&:last-child': {
flex: 1,
'&::after': {
display: 'none',
},
},
'&::after': {
position: 'absolute',
top: `calc(50% - ${token.paddingSM / 2}px)`,
insetInlineStart: '100%',
display: 'inline-block',
width: token.fontSizeIcon,
height: token.fontSizeIcon,
borderTop: `${token.lineWidth}px ${token.lineType} ${stepsNavArrowColor}`,
borderBottom: 'none',
borderInlineStart: 'none',
borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${stepsNavArrowColor}`,
transform: 'translateY(-50%) translateX(-50%) rotate(45deg)',
content: '""',
},
'&::before': {
position: 'absolute',
bottom: 0,
insetInlineStart: '50%',
display: 'inline-block',
width: 0,
height: token.lineWidthBold,
backgroundColor: stepsNavActiveColor,
transition: `width ${motionDurationSlow}, inset-inline-start ${motionDurationSlow}`,
transitionTimingFunction: 'ease-out',
content: '""',
},
},
[`${componentCls}-item${componentCls}-item-active::before`]: {
insetInlineStart: 0,
width: '100%',
},
},
[`&${componentCls}-navigation${componentCls}-vertical`]: {
[`> ${componentCls}-item`]: {