Skip to content

Commit

Permalink
fix(megamenu): fix alignment issues in mobile nav (carbon-design-syst…
Browse files Browse the repository at this point in the history
…em#5112)

### Related Ticket(s)

React & Web component: Mega Menu - Hamburger menu options are not left aligned and divider lines are missing. carbon-design-system#5079

### Description

BEFORE:
<img width="409" alt="Screen Shot 2021-02-05 at 4 18 47 PM" src="https://user-images.githubusercontent.com/54281166/107090920-eb16dc80-67ce-11eb-87d1-05b025535dda.png">

AFTER:
<img width="415" alt="Screen Shot 2021-02-05 at 3 56 45 PM" src="https://user-images.githubusercontent.com/54281166/107090929-ee11cd00-67ce-11eb-9bda-3370155643bc.png">

### Changelog
**Changed**

- set border-bottom and height for submenus
- set text to show ellipsis when overflow in menu item links

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "package: styles": Carbon Expressive -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
annawen1 authored and IgnacioBecerra committed Feb 22, 2021
1 parent 16f2e3e commit c8402d2
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions packages/styles/scss/components/masthead/_masthead-leftnav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,17 @@
@include carbon--type-style(body-short-02);

color: $text-01;
width: 100%;
text-overflow: ellipsis;
}
}
}

.#{$prefix}--side-nav__submenu {
display: flex;
flex-direction: column;

.#{$prefix}--side-nav__submenu-content {
width: 100%;
height: 100%;
height: rem(48px);
display: flex;
}

&::after {
content: '';
width: 100%;
border-bottom: 1px solid $ui-03;
}

Expand Down Expand Up @@ -304,7 +298,7 @@
width: 100%;

.#{$prefix}--side-nav__link-text {
align-self: end;
align-self: start;
margin-top: auto;
}

Expand All @@ -322,6 +316,11 @@
border-bottom: 1px solid $ui-04;
}

:host(#{$dds-prefix}-left-nav-menu[last-highlighted])
.#{$prefix}--side-nav__submenu
.#{$prefix}--side-nav__submenu-content,
.#{$prefix}--masthead__side-nav__last-highlighted
.#{$prefix}--side-nav__submenu-content,
.#{$prefix}--side-nav__menu-item.#{$prefix}--masthead__side-nav__last-highlighted
.#{$prefix}--side-nav__link::after,
:host(dds-left-nav-menu)
Expand All @@ -332,13 +331,6 @@
border-bottom: none;
}

.#{$prefix}--masthead__side-nav__last-highlighted,
:host(#{$dds-prefix}-left-nav-menu[last-highlighted]) {
.#{$prefix}--side-nav__submenu::after {
content: none;
}
}

.#{$prefix}--side-nav__submenu-platform {
flex-direction: row;

Expand Down

0 comments on commit c8402d2

Please sign in to comment.