Jump to content

7.1 Force hamburger menu on desktop - reduce spacing between pages and fix underline for active page

Recommended Posts

I've somewhat successfully used the following code to force a hamburger nav with side menu on 7.1:


.header .header-burger{display:flex}
.header-nav, .header-actions {display:none}

@media screen and (min-width: 960px) 
{ .header--menu-open .header-menu {
 opacity: 0.8; visibility: visible;
width: 30%; 
margin-left: 70%;
box-shadow: -5px 5px 15px #3ABDC4}}

.header--menu-open .header-menu a  {font-size: 20px; line-height: 0.4em !important; padding-top: 0rem !important; padding-bottom: 0rem !important; padding: 0rem !important;  }

 

However, I can't seem to target the space between page links. I've used the line-height to improve it slightly, but that puts the underline for the active page in the middle of the page name. I'm okay with keeping the underline if I can change line-height back to 1em but have a smaller space between the page titles. I'd like the social links to appear above the fold and have the vertical padding between items to be about 75% of what it is currently.

 

No password on the site, but it's currently on a cover page as home with no nav. Use the following url: https://apricots-seal-6csp.squarespace.com/work

 

Thanks in advance!

Link to comment
4 hours ago, chantelleandercastle said:

I've somewhat successfully used the following code to force a hamburger nav with side menu on 7.1:


.header .header-burger{display:flex}
.header-nav, .header-actions {display:none}

@media screen and (min-width: 960px) 
{ .header--menu-open .header-menu {
 opacity: 0.8; visibility: visible;
width: 30%; 
margin-left: 70%;
box-shadow: -5px 5px 15px #3ABDC4}}

.header--menu-open .header-menu a  {font-size: 20px; line-height: 0.4em !important; padding-top: 0rem !important; padding-bottom: 0rem !important; padding: 0rem !important;  }

 

However, I can't seem to target the space between page links. I've used the line-height to improve it slightly, but that puts the underline for the active page in the middle of the page name. I'm okay with keeping the underline if I can change line-height back to 1em but have a smaller space between the page titles. I'd like the social links to appear above the fold and have the vertical padding between items to be about 75% of what it is currently.

 

No password on the site, but it's currently on a cover page as home with no nav. Use the following url: https://apricots-seal-6csp.squarespace.com/work

 

Thanks in advance!

Try adding to Home > Desing > Custom Css

.header--menu-open .header-menu a {
  margin: 0;
  padding: 10px 20px !important;
  line-height: 1 !important;
}

Support me by pressing 👍  or marking as solution if this useful for you

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

My testing

image.thumb.png.3fa89cad58611b95735a7dd77c14a5eb.png

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

Thank you! That works great except for the padding also applied to the social icons:

image.thumb.png.3bfe46aacd91b79f88a1fd573af5939c.png

 

So I alterered the code slightly to get this:

 


.header--menu-open .header-menu a {
  margin: 0;
  font-size: 20px;
  font-padding: 10px 20px !important;
  line-height: 2.4 !important;
}
 

image.thumb.png.1661837f8a12dcc019bd2e48614697c3.png

 

Now if only I could get the text decoration (underline) for active page to stick closer to the text!

 

 

When I add font- in front of padding, it messes everything up like this:

 

 

 

Link to comment
On 12/14/2022 at 11:36 AM, chantelleandercastle said:

Thank you! That works great except for the padding also applied to the social icons:

image.thumb.png.3bfe46aacd91b79f88a1fd573af5939c.png

 

So I alterered the code slightly to get this:

 


.header--menu-open .header-menu a {
  margin: 0;
  font-size: 20px;
  font-padding: 10px 20px !important;
  line-height: 2.4 !important;
}
 

image.thumb.png.1661837f8a12dcc019bd2e48614697c3.png

 

Now if only I could get the text decoration (underline) for active page to stick closer to the text!

 

 

When I add font- in front of padding, it messes everything up like this:

 

 

 

To make underline - closer the text, just change line-height of nav items

/* Underline */
.header-menu-nav-item-content {
    line-height: 25px !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.