2022-07-28 20:33:10 +08:00
|
|
|
import type { MenuToken } from '.';
|
2022-11-23 20:22:38 +08:00
|
|
|
import type { GenerateStyle } from '../../theme/internal';
|
2022-05-23 10:58:30 +08:00
|
|
|
|
2022-11-19 13:47:33 +08:00
|
|
|
const getHorizontalStyle: GenerateStyle<MenuToken> = (token) => {
|
2022-05-23 10:58:30 +08:00
|
|
|
const {
|
|
|
|
componentCls,
|
|
|
|
motionDurationSlow,
|
|
|
|
menuHorizontalHeight,
|
2022-08-08 15:57:18 +08:00
|
|
|
colorSplit,
|
2022-05-23 10:58:30 +08:00
|
|
|
lineWidth,
|
|
|
|
lineType,
|
|
|
|
menuItemPaddingInline,
|
|
|
|
} = token;
|
|
|
|
|
|
|
|
return {
|
|
|
|
[`${componentCls}-horizontal`]: {
|
|
|
|
lineHeight: `${menuHorizontalHeight}px`,
|
|
|
|
border: 0,
|
2022-08-08 15:57:18 +08:00
|
|
|
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`,
|
2022-05-23 10:58:30 +08:00
|
|
|
boxShadow: 'none',
|
|
|
|
|
|
|
|
'&::after': {
|
|
|
|
display: 'block',
|
|
|
|
clear: 'both',
|
|
|
|
height: 0,
|
|
|
|
content: '"\\20"',
|
|
|
|
},
|
|
|
|
|
|
|
|
// ======================= Item =======================
|
|
|
|
[`${componentCls}-item, ${componentCls}-submenu`]: {
|
|
|
|
position: 'relative',
|
|
|
|
display: 'inline-block',
|
|
|
|
verticalAlign: 'bottom',
|
|
|
|
paddingInline: menuItemPaddingInline,
|
|
|
|
},
|
|
|
|
|
|
|
|
[`> ${componentCls}-item:hover,
|
|
|
|
> ${componentCls}-item-active,
|
|
|
|
> ${componentCls}-submenu ${componentCls}-submenu-title:hover`]: {
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
},
|
|
|
|
|
|
|
|
[`${componentCls}-item, ${componentCls}-submenu-title`]: {
|
|
|
|
transition: [`border-color ${motionDurationSlow}`, `background ${motionDurationSlow}`].join(
|
|
|
|
',',
|
|
|
|
),
|
|
|
|
},
|
|
|
|
|
|
|
|
// ===================== Sub Menu =====================
|
|
|
|
[`${componentCls}-submenu-arrow`]: {
|
|
|
|
display: 'none',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default getHorizontalStyle;
|