Skip to content

Commit

Permalink
fix(layout): fix pop menu style error
Browse files Browse the repository at this point in the history
close #7381
  • Loading branch information
chenshuai2144 committed Jul 28, 2023
1 parent fd4b9fd commit 36bfccf
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 103 deletions.
4 changes: 2 additions & 2 deletions packages/layout/src/components/SiderMenu/BaseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class MenuUtil {
{menuType === 'group' && collapsed ? null : shouldHasIcon &&
iconDom ? (
<span
className={`${baseClassName}-item-icon ${this.props?.hashId}`}
className={`${baseClassName}-item-icon ${this.props?.hashId}`.trim()}
>
{iconDom}
</span>
Expand Down Expand Up @@ -430,7 +430,7 @@ class MenuUtil {
)}
>
<span
className={`${baseClassName}-item-icon ${this.props?.hashId}`}
className={`${baseClassName}-item-icon ${this.props?.hashId}`.trim()}
style={{
display: defaultIcon === null && !icon ? 'none' : '',
}}
Expand Down
28 changes: 13 additions & 15 deletions packages/layout/src/components/SiderMenu/style/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const genProLayoutBaseMenuStyle: GenerateStyle<ProLayoutBaseMenuToken> = (
? token.layout?.header
: token.layout?.sider;

console.log(token.antCls);
return {
[`${token.componentCls}`]: {
background: 'transparent',
Expand Down Expand Up @@ -59,16 +58,6 @@ const genProLayoutBaseMenuStyle: GenerateStyle<ProLayoutBaseMenuToken> = (
},
},

[`${token.componentCls}-item-icon`]: {
height: '14px',
width: '14px',
opacity: '0.85',
lineHeight: '14px',
'> span.anticon': {
lineHeight: '14px!important',
height: '14px',
},
},
'&-item-title': {
display: 'flex',
flexDirection: 'row',
Expand Down Expand Up @@ -154,10 +143,19 @@ const genProLayoutBaseMenuStyle: GenerateStyle<ProLayoutBaseMenuToken> = (
lineHeight: 20,
},
},
[`${token.antCls}-menu-submenu${token.antCls}-menu-submenu-popup`]: {
[`${token.componentCls}-item-title`]: {
alignItems: 'flex-start',
},
...(mode.includes('horizontal')
? {}
: {
[`${token.antCls}-menu-submenu${token.antCls}-menu-submenu-popup`]: {
[`${token.componentCls}-item-title`]: {
alignItems: 'flex-start',
},
},
}),
[`${token.antCls}-menu-submenu-popup`]: {
backgroundColor: 'rgba(255, 255, 255, 0.42)',
'-webkit-backdrop-filter': 'blur(8px)',
backdropFilter: 'blur(8px)',
},
};
};
Expand Down
5 changes: 0 additions & 5 deletions packages/layout/src/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,6 @@ const genProLayoutStyle: GenerateStyle<ProLayoutToken> = (token) => {
background: token?.layout?.bgLayout,
},
},
[`${token.antCls}-menu-submenu-popup`]: {
backgroundColor: 'rgba(255, 255, 255, 0.42)',
'-webkit-backdrop-filter': 'blur(8px)',
backdropFilter: 'blur(8px)',
},
};
};

Expand Down
2 changes: 1 addition & 1 deletion tests/form/__snapshots__/demo.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47625,7 +47625,7 @@ exports[`form demos 📸 renders ./packages/form/src/demos/layout-footer.tsx cor
class="ant-pro-base-menu-inline-item-title ant-pro-base-menu-inline-item-title-collapsed"
>
<span
class="ant-pro-base-menu-inline-item-icon "
class="ant-pro-base-menu-inline-item-icon"
>
<span
aria-label="smile"
Expand Down
Loading

0 comments on commit 36bfccf

Please sign in to comment.