Jump to content

How to change the size of the hamburger icon? (height and width)

Go to solution Solved by tuanphan,

Recommended Posts

I'm trying to change the overall size of the hamburger icon for mobile only. I need it smaller (width and length).

I've tried code from these forums which adjusts the width only, but this is only half of the job.

It also looks to me like it is not fully left-aligned. It is further away from the left side than the cart icon from the right side, and you can see this more when the overlay menu is opened and it is inset further to the centre than the menu items itself. Any ideas how to adjust that so it is fully on the left?

Ideal example and current website screenshots attached:
https://www.manfortoday.com
 

IMG_1594.PNG

IMG_1595.PNG

IMG_1596.PNG

Link to comment
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi @johnpaulstuthridge, give this code a try:

// MAKE BURGER MENU SMALLER //
.burger-inner.header-menu-icon-tripleLineHamburger .top-bun {
  transform: translatey(-6px);
}

.burger-inner.header-menu-icon-tripleLineHamburger .bottom-bun {
  transform: translatey(6px);
}

.burger-inner > div {
  width: 60% !important;
}

You can adjust the -6px and 6px up and down, which is the space in between the lines. You'll want these to be the same number for both the negative and positive so they're evenly spaced. The 60% can be changed also, this is the width of the lines within the burger menu container.

Screenshot of how this code looks on my end:

image.png.9e3284c1d9be227364f7c6cb49ee5f76.png

Edited by CassAggett
added screenshot

If this helped you, please like or mark my solution as answer so others can scroll to it quickly 👆

Cass Aggett is a Squarespace website designer for go-getting women – no matter what stage of business.

WEBSITEINSTAGRAM

 

Link to comment
  • Solution
On 9/17/2023 at 3:48 PM, johnpaulstuthridge said:

That works amazingly well, thank you!

- It has removed the cross into a X shape, which is fine, but was that supposed to happen?

You can change above code to this

body:not(.header--menu-open) .burger-inner.header-menu-icon-tripleLineHamburger .top-bun {
    transform: translatey(-6px);
}

body:not(.header--menu-open) .burger-inner.header-menu-icon-tripleLineHamburger .bottom-bun {
    transform: translatey(6px);
}

body:not(.header--menu-open) .burger-inner>div {
    width: 50% !important;
}

 

Edited by tuanphan
missing ; symbols

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.