mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 00:29:12 +08:00
c8bd145ab4
* fix: Fix the issue where the custom icon is not vertically centered at the default size of Steps * Co-authored-by: nova1751 <nova1751@users.noreply.github.com> --------- Co-authored-by: nova1751 <nova1751@users.noreply.github.com> Co-authored-by: 红 <wxh1220@gmail.com>
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import type { CSSObject } from '@ant-design/cssinjs';
|
|
import { unit } from '@ant-design/cssinjs';
|
|
|
|
import type { StepsToken } from '.';
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
|
|
const genStepsCustomIconStyle: GenerateStyle<StepsToken, CSSObject> = (token) => {
|
|
const { componentCls, customIconTop, customIconSize, customIconFontSize } = token;
|
|
|
|
return {
|
|
[`${componentCls}-item-custom`]: {
|
|
[`> ${componentCls}-item-container > ${componentCls}-item-icon`]: {
|
|
height: 'auto',
|
|
background: 'none',
|
|
border: 0,
|
|
[`> ${componentCls}-icon`]: {
|
|
top: customIconTop,
|
|
width: customIconSize,
|
|
height: customIconSize,
|
|
fontSize: customIconFontSize,
|
|
lineHeight: `${unit(customIconSize)}`,
|
|
},
|
|
},
|
|
},
|
|
|
|
// Only adjust horizontal customize icon width
|
|
[`&:not(${componentCls}-vertical)`]: {
|
|
[`${componentCls}-item-custom`]: {
|
|
[`${componentCls}-item-icon`]: {
|
|
width: 'auto',
|
|
background: 'none',
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
export default genStepsCustomIconStyle;
|