Files
ant-design/components/menu/style/horizontal.ts
lijianan f7446f3f1f refactor(css): replace background transition with background-color (#56598)
* fix(css): replace background transition with background-color

* chore: update

---------

Co-authored-by: thinkasany <480968828@qq.com>
2026-01-15 11:04:33 +08:00

61 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-color ${motionDurationSlow}`,
].join(','),
},
// ===================== Sub Menu =====================
[`${componentCls}-submenu-arrow`]: {
display: 'none',
},
},
};
};
export default getHorizontalStyle;