antd
Version:
An enterprise-class UI design language and React components implementation
44 lines (43 loc) • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const genIconStyle = token => {
const {
componentCls,
customIconFontSize,
motionDurationSlow
} = token;
const itemCls = `${componentCls}-item`;
return {
[componentCls]: {
'--steps-icon-size': token.iconSize,
'--steps-icon-border-width': token.lineWidth,
[`${itemCls}-icon`]: {
width: 'var(--steps-icon-size)',
height: 'var(--steps-icon-size)',
margin: 0,
flex: 'none',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: token.iconFontSize,
fontFamily: token.fontFamily,
lineHeight: 'var(--steps-icon-size)',
textAlign: 'center',
borderRadius: 'var(--steps-icon-size)',
border: `var(--steps-icon-border-width) ${token.lineType} transparent`,
transition: ['background', 'border', 'color', 'inset', 'transform'].map(key => `${key} ${motionDurationSlow}`).join(', '),
zIndex: 1
},
// ==================== Custom ====================
[`${itemCls}-custom ${itemCls}-icon`]: {
background: 'none',
border: 0,
fontSize: customIconFontSize
}
}
};
};
var _default = exports.default = genIconStyle;