ant-design/components/steps/style/inline.ts
二货爱吃白萝卜 8db39e34a7
feat: ConfigProvider support classNames and styles for Steps (#53789)
* basic flex

* chore: style basic

* chore: status style

* chore: small size

* chore: label vertical

* chore: more style

* chore: hover disabled

* chore: variant

* chore: dot variant

* chore: max width

* chore: hover dot

* chore: update style

* chore: click style

* chore: init percent

* chore: pass detail

* chore: for progress

* chore: clean up

* chore: clean up

* chore: multiple css var

* chore: status text

* chore: status use var

* chore: fix nest

* chore: use svg

* chore: type of panel

* chore: offset support

* chore: inline offset

* chore: warning of steps

* docs: add semantic preview

* chore: semantic transition

* chore: hover

* chore: adjust style

* chore: update semantic preview

* chore: fix nav style

* chore: patch panel motion

* chore: update semantic preview

* docs: update config provider doc

* chore: fix part ts def

* chore: fix test ts

* test: update test case

* test: coverage

* chore: fix lint

* test: update test case

* test: update snapshot

* chore: adjust style

* chore: fix rtl

* docs: update design

* chore: update sctructure

* chore: update comment

* chore: clean up

* chore: clean up

* chore: cursor style

* chore: coverage

* docs: add missing part

* chore: order

* test: add test case

* chore: fix ts

* chore: clean up
2025-05-13 20:36:54 +08:00

84 lines
2.3 KiB
TypeScript

import type { CSSObject } from '@ant-design/cssinjs';
import type { StepsToken } from '.';
import type { GenerateStyle } from '../../theme/internal';
const genInlineStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
const { componentCls, inlineDotSize } = token;
const containerPaddingTop = token.calc(token.paddingXS).add(token.lineWidth).equal();
const itemCls = `${componentCls}-item`;
return {
[`${componentCls}-inline`]: {
'--steps-items-offset': '0',
'--steps-item-wrapper-padding-top': containerPaddingTop,
display: 'inline-flex',
'&:before': {
content: '""',
flex: 'var(--steps-items-offset)',
},
[itemCls]: {
// ========================= Variable =========================
// Item
'--steps-label-vertical-row-gap': token.paddingXS,
// Icon
'--steps-icon-size': inlineDotSize,
'--ant-steps-dot-size': inlineDotSize,
'--ant-steps-dot-current-size': inlineDotSize,
// Title
'--steps-title-font-size': token.fontSizeSM,
'--steps-title-line-height': token.lineHeightSM,
'--steps-item-title-color': token.colorTextSecondary,
'--steps-subtitle-font-size': token.fontSizeSM,
'--steps-subtitle-line-height': token.lineHeightSM,
'--steps-item-subtitle-color': token.colorTextQuaternary,
// Rail
'--steps-rail-size': token.lineWidth,
'--steps-label-horizontal-rail-gap': '0px',
// ========================== Styles ==========================
flex: 1,
'&-wrapper': {
paddingInline: token.paddingXXS,
marginInline: token.calc(token.marginXXS).div(2).equal(),
borderRadius: token.borderRadiusSM,
cursor: 'pointer',
transition: `background ${token.motionDurationMid}`,
'&:hover': {
background: token.controlItemBgHover,
},
},
// Icon
'&-icon': {
[`${itemCls}-icon-dot`]: {
'&:after': {
display: 'none',
},
},
},
// Header
'&-title': {
fontWeight: 'normal',
whiteSpace: 'nowrap',
},
'&-content': {
display: 'none',
},
},
},
};
};
export default genInlineStyle;