Skip to content

Commit

Permalink
[MWPW-134805] Remove borders when more sections are used (#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
overmyheadandbody committed Aug 10, 2023
1 parent a03b5f8 commit 15b21ea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libs/blocks/global-navigation/global-navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ header.global-navigation {
padding: 0 8px;
}

.feds-navItem--section {
.feds-navItem--section:only-of-type {
border-left: 1px solid var(--feds-borderColor--light);
border-right: 1px solid var(--feds-borderColor--light);
}
Expand Down
5 changes: 3 additions & 2 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,11 @@ class Gnav {
</a>`;

const isSectionMenu = item.closest('.section') instanceof HTMLElement;
const tag = isSectionMenu ? 'section' : 'div';
const triggerTemplate = toFragment`
<div class="feds-navItem${isSectionMenu ? ' feds-navItem--section' : ''}">
<${tag} class="feds-navItem${isSectionMenu ? ' feds-navItem--section' : ''}">
${dropdownTrigger}
</div>`;
</${tag}>`;

// Toggle trigger's dropdown on click
dropdownTrigger.addEventListener('click', (e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</aside>
</div>
<div class="feds-nav" style="padding-bottom: 64px">
<div
<section
class="feds-navItem feds-navItem--section feds-navItem--megaMenu"
>
<a
Expand Down Expand Up @@ -455,7 +455,7 @@
</div>
</div>
</div>
</div>
</section>
<div class="feds-navItem">
<a
href="#"
Expand Down
4 changes: 2 additions & 2 deletions test/blocks/global-navigation/keyboard/mocks/global-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>
<div class="feds-nav-wrapper">
<div class="feds-nav">
<div
<section
class="feds-navItem feds-navItem--section feds-navItem--megaMenu"
>
<a
Expand Down Expand Up @@ -352,7 +352,7 @@
</div>
</div>
</div>
</div>
</section>
<div class="feds-navItem">
<a
href="#"
Expand Down

0 comments on commit 15b21ea

Please sign in to comment.