mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 20:38:45 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import { unit } from '@ant-design/cssinjs';
|
|
|
|
import type { MenuToken } from '.';
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
|
|
const getHorizontalStyle: GenerateStyle<MenuToken> = (token) => {
|
|
const {
|
|
componentCls,
|
|
motionDurationSlow,
|
|
horizontalLineHeight,
|
|
colorSplit,
|
|
lineWidth,
|
|
lineType,
|
|
itemPaddingInline,
|
|
} = token;
|
|
|
|
return {
|
|
[`${componentCls}-horizontal`]: {
|
|
lineHeight: horizontalLineHeight,
|
|
border: 0,
|
|
borderBottom: `${unit(lineWidth)} ${lineType} ${colorSplit}`,
|
|
boxShadow: 'none',
|
|
|
|
'&::after': {
|
|
display: 'block',
|
|
clear: 'both',
|
|
height: 0,
|
|
content: '"\\20"',
|
|
},
|
|
|
|
// ======================= Item =======================
|
|
[`${componentCls}-item, ${componentCls}-submenu`]: {
|
|
position: 'relative',
|
|
display: 'inline-block',
|
|
verticalAlign: 'bottom',
|
|
paddingInline: itemPaddingInline,
|
|
},
|
|
|
|
[`> ${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;
|