Skip to content

Commit

Permalink
Merge pull request #1427 from CuBoulder/issue/1408
Browse files Browse the repository at this point in the history
Remove double borders on menus
  • Loading branch information
jcsparks authored and web-flow committed Oct 23, 2024
2 parents 7c3235a + 05ef6e1 commit 8f7e04e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- ### Remove double borders on menus
Resolves #1408.
Removes the double borders on menus in the above and below content regions.
---

- ### Make video hero vertically centered
Resolves #1352.
Makes the video hero more vertically centered
Expand Down
7 changes: 7 additions & 0 deletions css/ucb-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@
.ucb-page-content .ucb-menu li.menu-item {
border-bottom: 1px solid rgba(0, 0, 0, .09);
}
.ucb-above-content-region .ucb-menu li.menu-item,
.ucb-below-content-region .ucb-menu li.menu-item {
border-bottom: none;
}

.ucb-page-content .ucb-menu li.menu-item.active {
background-color: inherit;
Expand Down Expand Up @@ -416,13 +420,16 @@ width: fit-content;
margin-bottom: -1px;
text-align: left;
}
.ucb-above-content-region .ucb-menu a,
.ucb-below-content-region .ucb-menu a {
display: block;
padding: 10px 0;
border-bottom: 1px solid rgba(128, 128, 128, 0.333);
margin-bottom: -1px;
}

.ucb-above-content-region .ucb-mega-menu,
.ucb-above-content-region .ucb-mega-menu-icon,
.ucb-below-content-region .ucb-mega-menu,
.ucb-below-content-region .ucb-mega-menu-icon,
.ucb-footer-top .ucb-mega-menu,
Expand Down
12 changes: 12 additions & 0 deletions js/ucb-mega-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,16 @@ for (let i = 0; i < belowContentMenus.length; i++) {
allMegaMenus[j].removeAttribute("aria-expanded");
allMegaMenus[j].removeAttribute("aria-controls");
}
}

// Disable Above Content Menu Mega Menus
const aboveContentMenus = document.getElementsByClassName("ucb-above-content-region");
for (let i = 0; i < aboveContentMenus.length; i++) {
const allMegaMenus = aboveContentMenus[i].getElementsByClassName("ucb-mega-menu-outer-link");
for (let j = 0; j < allMegaMenus.length; j++) {
allMegaMenus[j].removeAttribute("data-bs-toggle");
allMegaMenus[j].removeAttribute("data-bs-target");
allMegaMenus[j].removeAttribute("aria-expanded");
allMegaMenus[j].removeAttribute("aria-controls");
}
}
15 changes: 14 additions & 1 deletion js/ucb-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,22 @@ for (let i = 0; i < belowContentRegion.length; i++) {
totalMenus = allBelowContentMenus.length;
for (let j = 0; j < allBelowContentMenus.length; j++) {
allBelowContentMenus[j].classList.add("ucb-menu-column-" + totalMenus);
allBelowContentMenus[j].parentElement.classList.add("ucb-menu-column-wrapper");
allBelowContentMenus[j].parentElement.classList.add("ucb-menu-column-wrapper");
}
}

// Add columns for Above Content Menus
totalMenus = 0;
const aboveContentRegion = document.getElementsByClassName("ucb-above-content-region");
for (let i = 0; i < aboveContentRegion.length; i++) {
const allAboveContentMenus = aboveContentRegion[i].getElementsByClassName("ucb-system-menu-block");
totalMenus = allAboveContentMenus.length;
for (let j = 0; j < allAboveContentMenus.length; j++) {
allAboveContentMenus[j].classList.add("ucb-menu-column-" + totalMenus);
allAboveContentMenus[j].parentElement.classList.add("ucb-menu-column-wrapper");
}
}

// Add columns for Footer Menus
totalMenus = 0;
const footerRegion = document.getElementsByClassName("ucb-footer-top");
Expand Down

0 comments on commit 8f7e04e

Please sign in to comment.