ant-design/components/steps/style/small.ts
PCCCCCCC f4411d9393
Refactor:Component Steps Less to cssInJs (#35058)
* refactor: Steps cssInJs add basic structure

* refactor: change Component Steps less into cssInJs

* refactor: ♻️ steps cssInJs code formated

* style: 💄 change Steps cssinjs left and right into Logical Properties

* style: 💄 steps cssinjs add FIXME for number hardcode

* style: 💄 steps cssinjs dismiss useless rtl style

* style: 💄 step cssinjs fix the 'not compatible with RTL mode' warning and fix the style in RTL mode

* style: code formated for FIXME

* style: revert the change about _skip_check_

* style: step cssinjs margin/padding used with Logical properties

* ci: fix lint check

* style: fix the style on RTL

* style: try fix the step subtitle order on RTL mode

* style: optimization the style on RTL and dismiss duplicate styles with logical properties
2022-04-19 11:28:06 +08:00

69 lines
2.1 KiB
TypeScript

import type { CSSObject } from '@ant-design/cssinjs';
import type { GenerateStyle } from '../../_util/theme';
import type { StepsToken } from '.';
const genStepsSmallStyle: GenerateStyle<StepsToken, CSSObject> = token => {
const {
componentCls,
stepsSmallIconSize,
// stepsSmallIconMargin,
fontSizeSM,
fontSizeBase,
colorTextSecondary,
} = token;
return {
[`&${componentCls}-small`]: {
[`&${componentCls}-horizontal:not(${componentCls}-label-vertical) ${componentCls}-item`]: {
paddingInlineStart: 12, // FIXME: hardcode in v4
'&:first-child': {
paddingInlineStart: 0, // FIXME: hardcode in v4
},
},
[`${componentCls}-item-icon`]: {
width: stepsSmallIconSize,
height: stepsSmallIconSize,
// margin: stepsSmallIconMargin,
marginTop: 0, // FIXME: hardcode in v4
marginBottom: 0, // FIXME: hardcode in v4
marginInline: '0 8px', // FIXME: hardcode in v4
fontSize: fontSizeSM,
lineHeight: `${stepsSmallIconSize}px`,
textAlign: 'center',
borderRadius: stepsSmallIconSize,
},
[`${componentCls}-item-title`]: {
paddingInlineEnd: 12, // FIXME: hardcode in v4
fontSize: fontSizeBase,
lineHeight: `${stepsSmallIconSize}px`,
'&::after': {
top: stepsSmallIconSize / 2, // FIXME: hardcode in v4
},
},
[`${componentCls}-item-description`]: {
color: colorTextSecondary,
fontSize: fontSizeBase,
},
[`${componentCls}-item-tail`]: {
top: 8, // FIXME: hardcode in v4
},
[`${componentCls}-item-custom ${componentCls}-item-icon`]: {
width: 'inherit',
height: 'inherit',
lineHeight: 'inherit',
background: 'none',
border: 0, // FIXME: hardcode in v4
borderRadius: 0, // FIXME: hardcode in v4
[`> ${componentCls}-icon`]: {
fontSize: stepsSmallIconSize,
lineHeight: `${stepsSmallIconSize}px`,
transform: 'none',
},
},
},
};
};
export default genStepsSmallStyle;