I tried both solutions you’ve proposed. The first one did not work, because it gave all the menu items the same width, even though some of the words are longer. I’ve been working with the solutions offered in the second link and I think we’re on the right track.
I’ve added several increments to optimize the padding between elements:
}
/* Set top level menu item padding when screen width below 1200px */
@media only screen and (max-width : 1200px) {
#{$wrap} #{$menu} > li.mega-menu-item > a.mega-menu-link {
padding-left: 15px;
padding-right: 15px;
}
}
/* Set top level menu item padding when screen width below 1100px */
@media only screen and (max-width : 1100px) {
#{$wrap} #{$menu} > li.mega-menu-item > a.mega-menu-link {
padding-left: 10px;
padding-right: 10px;
}
}
/* Set top level menu item padding when screen width below 1000px */
@media only screen and (max-width : 1000px) {
#{$wrap} #{$menu} > li.mega-menu-item > a.mega-menu-link {
padding-left: 7.5px;
padding-right: 7.5px;
}
}
/* Set top level menu item padding when screen width below 900px */
@media only screen and (max-width : 900px) {
#{$wrap} #{$menu} > li.mega-menu-item > a.mega-menu-link {
padding-left: 5px;
padding-right: 5px;
}
}
/* Set top level menu item padding when screen width below 875px */
@media only screen and (max-width : 875px) {
#{$wrap} #{$menu} > li.mega-menu-item > a.mega-menu-link {
padding-left: 3px;
padding-right: 3px;
}
}
However, I’m still getting line breaks at certain increments in between those widths.
If there was a way to make these percentage-based (e.g., a percentage of the container or menu bar width), then I believe this would prevent the undesirable line breaks/wrapping.
My goal is to match the responsive functionality of the menus on this site.