docs: improve Header menu style (#48597)

This commit is contained in:
afc163 2024-04-24 09:51:46 +08:00 committed by GitHub
parent 3e0c7f7323
commit 8812b14e9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 24 deletions

View File

@ -46,7 +46,7 @@ const useStyle = createStyles(({ token }) => {
height: 100%;
font-size: ${fontSize}px;
font-family: Avenir, ${fontFamily}, sans-serif;
border: 0;
border: 0 !important;
&${antCls}-menu-horizontal {
border-bottom: none;
@ -93,25 +93,6 @@ const useStyle = createStyles(({ token }) => {
text-align: center;
}
`,
popoverMenuNav: css`
${antCls}-menu-item,
${antCls}-menu-submenu {
text-align: left;
}
${antCls}-menu-item-group-title {
padding-inline-start: ${token.paddingLG}px;
}
${antCls}-menu-item-group-list {
padding: 0 ${token.paddingLG}px;
}
${antCls}-menu-item,
a {
color: #333;
}
`,
};
});

View File

@ -51,6 +51,7 @@ const useStyle = createStyles(({ token, css }) => {
@media only screen and (max-width: ${token.mobileMaxWidth}px) {
text-align: center;
border: none;
}
.nav-search-wrapper {
@ -175,9 +176,6 @@ const Header: React.FC = () => {
const onWindowResize = useCallback(() => {
setHeaderState((prev) => ({ ...prev, windowWidth: window.innerWidth }));
}, []);
const handleShowMenu = useCallback(() => {
setHeaderState((prev) => ({ ...prev, menuVisible: true }));
}, []);
const onMenuVisibleChange = useCallback((visible: boolean) => {
setHeaderState((prev) => ({ ...prev, menuVisible: visible }));
}, []);
@ -362,7 +360,7 @@ const Header: React.FC = () => {
arrow={{ pointAtCenter: true }}
onOpenChange={onMenuVisibleChange}
>
<MenuOutlined className="nav-phone-icon" onClick={handleShowMenu} />
<MenuOutlined className="nav-phone-icon" />
</Popover>
)}
{isZhCN && bannerVisible && (