Skip to content

Commit

Permalink
fix(navbar): prevent menu-items from growing when hovered (#3640)
Browse files Browse the repository at this point in the history
* fix(navbar): prevent menu-items from growing when hovered
  • Loading branch information
misama-ct authored Nov 20, 2024
1 parent f8e1162 commit 6e0d117
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/sweet-lemons-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-frontend/application-shell': patch
---

Submenu-items inside Navbar submenus won't change their dimension on hover anymore
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ const TextLinkSublistWrapper = styled.div`
const NavlinkClickableContent = styled.div`
height: 100%;
width: 100%;
display: block;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
transition: all 150ms ease-out;
position: relative;
left: calc(-1 * ${uiKitDesignTokens.spacing20});
`;

const listStyles = css`
Expand Down Expand Up @@ -179,11 +189,11 @@ const SublistItem = styled.li<{ isActive: boolean }>`
display: flex;
align-items: center;
align-self: stretch;
border-radius: ${uiKitDesignTokens.borderRadius4};
${(props) => [
props.isActive &&
css`
border-radius: ${uiKitDesignTokens.borderRadius4};
background: ${uiKitDesignTokens.colorPrimary40};
`,
!props.isActive &&
Expand All @@ -196,12 +206,9 @@ const SublistItem = styled.li<{ isActive: boolean }>`
background: ${uiKitDesignTokens.colorPrimary95};
[data-link-level='text-link-sublist'] {
/* additional left padding on hover and focus */
padding: ${uiKitDesignTokens.spacing25}
${uiKitDesignTokens.spacing25} ${uiKitDesignTokens.spacing25}
calc(
${uiKitDesignTokens.spacing30} + ${uiKitDesignTokens.spacing20}
);
> ${NavlinkClickableContent} {
left: 0;
}
}
}
`,
Expand Down
2 changes: 1 addition & 1 deletion packages/application-shell/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const NAVBAR = {
sublistIndentationWhenCollapsed: '72px',
sublistIndentationWhenExpanded: '248px',
sublistItemMinHeight: '50px',
sublistWidth: '253px',
sublistWidth: '272px',
leftNavigationTransition: 'all 150ms cubic-bezier(1, 0, 0.58, 1)',
widthLeftNavigation: '80px',
widthLeftNavigationWhenExpanded: '256px',
Expand Down

0 comments on commit 6e0d117

Please sign in to comment.