Hi there, I am trying to reduce the line height / margin / padding, between menu / navigation / link items on the mobile menu. I’ve tried lots of different code variations but I can’t get anything to work.
Thanks
A user seeks to reduce spacing between menu items in the Fabric theme’s mobile navigation. The issue involves multiple menu levels requiring different CSS adjustments.
Initial Solution:
.menu-drawer__menu-item and .menu-drawer__list-item with min-height: 34px !important in a media query for screens under 749pxbase.css file via Shopify admin--button-border-width: none !importantComplications:
#link-shop selector didn’t work for third level itemsCurrent Status:
Hi there, I am trying to reduce the line height / margin / padding, between menu / navigation / link items on the mobile menu. I’ve tried lots of different code variations but I can’t get anything to work.
Thanks
@hausofmossandmoon can you please share this page link?
Regards,
Suyash
To build shopify pages use pagefly
pw: moss
@hausofmossandmoon
please add this css to the very end of your base.css file and check
shopify admin->online store->themes->edit theme code->assets->base.css
@media screen and (max-width:749px){
.menu-drawer__close-button{margin-right: 10px;}
.menu-drawer__menu>.menu-drawer__list-item{min-height: 34px;}
menu-drawer__menu .menu-drawer__menu-item{min-height: 34px;}
}
close button placement worked, but the spacing of menu items didnt. thank you
try adding !important so it becomes
@media screen and (max-width:749px){
.menu-drawer__close-button{margin-right: 10px;}
.menu-drawer__menu .menu-drawer__list-item{min-height: 34px !important;}
.menu-drawer__menu .menu-drawer__menu-item{min-height: 34px !important;}
}
thank you that worked, i forgot about important!
it didn’t however translate over to the ‘shop’ page though - only ‘crystals’ and ‘connect’ worked.
is there a way to remove the border around the ‘close’ button entirely, i tried to no avail!
all the menu options have same settings, but shop items do not have borders and hence look different
to remove border around close button, please add this
.menu-drawer__close-button {--button-border-width: none !important;}
thank you that worked!
sorry im looking for the code for the ‘sub menu’ / third level links to also have 34px
@hausofmossandmoon which menu item have 3rd level sub menu?
@hausofmossandmoon all these have 34 height only
can i reduce the height of those ones ?, i want them them to be closer together. thank you
@hausofmossandmoon if you want for links of only shop menu then please try this
@media screen and (max-width:749px){
#link-shop .menu-drawer__menu .menu-drawer__list-item{min-height: 34px !important;}
#link-shop .menu-drawer__menu .menu-drawer__menu-item{min-height: 34px !important;}
}
hey, that didn’t work. i need to reduce the space between these menu links, thank you. i believe they are third level, perhaps sub menu ?
Are you saying it’s impossible to reduce the spacing between third level items?
I don’t want third level items to be 35px gap, I would like to reduce the spacing between them using css that I can edit. Perhaps around 18px gap.
It is not impossible, but it shares same css as others and hence it also has height 35px, if we change it then it will. change for all