Skip to content

Commit

Permalink
fix(layout): support hover token
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Oct 13, 2022
1 parent 000e804 commit 8eb4545
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/layout/src/ProLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ const BaseProLayout: React.FC<ProLayoutProps> = (props) => {
<Layout
style={{
minHeight: '100%',
// hack style
flexDirection: siderMenuDom ? 'row' : undefined,
...style,
}}
Expand Down
2 changes: 2 additions & 0 deletions packages/layout/src/components/PageContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ const PageContainer: React.FC<PageContainerProps> = (props) => {
children,
basePageContainer,
hashId,
propsToken?.paddingBlockPageContainerContent,
propsToken?.paddingInlinePageContainerContent,
value.hasFooterToolbar,
pageContainer.paddingBlockPageContainerContent,
]);
Expand Down
11 changes: 6 additions & 5 deletions packages/layout/src/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const compatibleStyle: GenerateStyle<ProLayoutToken & LayoutDesignToken> = (toke
${token.antCls}-menu-submenu-active,
${token.antCls}-menu-submenu-title:hover`]: {
color: token.sider.colorTextMenuActive,
backgroundColor: token.sider.colorBgMenuItemHover,
borderRadius: token.radiusBase,
[`${token.antCls}-menu-submenu-arrow`]: {
color: token.sider.colorTextMenuActive,
Expand All @@ -77,6 +78,7 @@ const compatibleStyle: GenerateStyle<ProLayoutToken & LayoutDesignToken> = (toke
${token.antCls}-menu-submenu-title:hover`]: {
color: token.sider.colorTextMenuActive,
borderRadius: token.radiusBase,
backgroundColor: token.sider.colorBgMenuItemHover,
[`${token.antCls}-menu-submenu-arrow`]: {
color: token.sider.colorTextMenuActive,
},
Expand Down Expand Up @@ -112,6 +114,7 @@ const compatibleStyle: GenerateStyle<ProLayoutToken & LayoutDesignToken> = (toke
${token.antCls}-menu-submenu-active`]: {
borderRadius: 4,
color: token.header.colorTextMenuActive,
backgroundColor: token.header.colorBgMenuItemHover,
},

[`${token.antCls}-menu-item-open,
Expand Down Expand Up @@ -149,15 +152,16 @@ const compatibleStyle: GenerateStyle<ProLayoutToken & LayoutDesignToken> = (toke
${token.antCls}-menu-submenu-title:hover`]: {
color: token.header.colorTextMenuActive,
borderRadius: token.radiusBase,
backgroundColor: token.header.colorBgMenuItemSelected,
[`${token.antCls}-menu-submenu-arrow`]: {
color: token.header.colorTextMenuActive,
},
},

[`${token.antCls}-menu-item-selected`]: {
color: token.header.colorTextMenuActive,
fontWeight: 'bold',
color: token.header.colorTextMenuSelected,
borderRadius: token.radiusBase,
backgroundColor: token.header.colorBgMenuItemSelected,
},
},
},
Expand All @@ -179,18 +183,15 @@ const compatibleStyle: GenerateStyle<ProLayoutToken & LayoutDesignToken> = (toke
},
[`${token.antCls}-menu-item-selected`]: {
color: token.sider.colorTextMenuSelected,
fontWeight: 'bold',
},
[`${token.antCls}-menu-submenu-selected`]: {
color: token.sider.colorTextMenuSelected,
fontWeight: 'bold',
},
[`${token.antCls}-menu:not(${token.antCls}-menu-horizontal)`]: {
[`${token.antCls}-menu-item-selected`]: {
backgroundColor: 'rgba(0, 0, 0, 0.04)',
borderRadius: token.radiusBase,
color: token.sider.colorTextMenuSelected,
fontWeight: 'bold',
},
[`${token.antCls}-menu-item:hover,
${token.antCls}-menu-item-active,
Expand Down

0 comments on commit 8eb4545

Please sign in to comment.