antd
Version:
An enterprise-class UI design language and React components implementation
53 lines (52 loc) • 1.68 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.prepareComponentToken = void 0;
const prepareComponentToken = token => {
const {
fontSize,
lineHeight,
controlHeight,
controlHeightSM,
controlHeightLG,
paddingXXS,
controlPaddingHorizontal,
zIndexPopupBase,
colorText,
fontWeightStrong,
controlItemBgActive,
controlItemBgHover,
colorBgContainer,
colorFillSecondary,
colorBgContainerDisabled,
colorTextDisabled
} = token;
const multipleItemHeight = controlHeight - paddingXXS * 2;
const multipleItemHeightSM = controlHeightSM - paddingXXS * 2;
const multipleItemHeightLG = controlHeightLG - paddingXXS * 2;
return {
zIndexPopup: zIndexPopupBase + 50,
optionSelectedColor: colorText,
optionSelectedFontWeight: fontWeightStrong,
optionSelectedBg: controlItemBgActive,
optionActiveBg: controlItemBgHover,
optionPadding: `${(controlHeight - fontSize * lineHeight) / 2}px ${controlPaddingHorizontal}px`,
optionFontSize: fontSize,
optionLineHeight: lineHeight,
optionHeight: controlHeight,
selectorBg: colorBgContainer,
clearBg: colorBgContainer,
singleItemHeightLG: controlHeightLG,
multipleItemBg: colorFillSecondary,
multipleItemBorderColor: 'transparent',
multipleItemHeight,
multipleItemHeightSM,
multipleItemHeightLG,
multipleSelectorBgDisabled: colorBgContainerDisabled,
multipleItemColorDisabled: colorTextDisabled,
multipleItemBorderColorDisabled: 'transparent',
showArrowPaddingInlineEnd: Math.ceil(token.fontSize * 1.25)
};
};
exports.prepareComponentToken = prepareComponentToken;
;