Jump to content

Menu (Hamburger) Button for Desktop

Go to solution Solved by tuanphan,

Recommended Posts

Posted

I was wondering if it could be possible to have a menu (hamburger) button for my site navigation on desktop? I know it's not standard for desktop view, but I feel like it could be done since the design is already there for mobile. I would like to have the menu icon in left corner, three lines and with the word Menu. When clicked, the menu section fill 1/3 (left side) of the page, with the text aligned left. Thanks in advanced!

  • Solution
Posted

Add to Design > Custom CSS

 /* Force burger on desktop */
  .header-burger {
    display: flex !important
}

.header--menu-open .header-menu {
    opacity: 1 !important;
    visibility: visible !important
}

.header-nav {
    visibility: hidden !important
}
@media screen and (min-width: 768px) {
    .header-menu {
        width: 25%
    }
}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted

That worked, but the page title (logo area) shifted right (see attached). And could I add the word "Menu" next to the menu?

Screenshot2023-07-25at6_29_32PM.thumb.png.36127c128170c282da12217b5705364a.png

Posted

Another issue I discovered: (ignore cart)

Screenshot2023-07-26at3_58_53PM.thumb.png.59dd8228677c41b48230f8aaa1bab3e7.pngScreenshot2023-07-26at3_57_44PM.thumb.png.15d33e3488c46ab7839679b0118c7a66.png

If it would help, you could set where you can see page behind (the 2/3 section of the menu) to Hex: 19110B. IDK

Posted
On 7/26/2023 at 5:34 AM, vincenttodd said:

That worked, but the page title (logo area) shifted right (see attached). And could I add the word "Menu" next to the menu?

Screenshot2023-07-25at6_29_32PM.thumb.png.36127c128170c282da12217b5705364a.png

Use this code

a#site-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.header-menu-nav-folder[data-folder="root"]~div:not(.header-menu-nav-folder--active) {
    opacity: 0;
}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 2 weeks later...
Posted

I've found a couple small issues I was wondering if you could help with:

1) I tried changing the navigation margins with the CSS below but it only changed the first nav section. i.g. https://www.toddagriscience.com navigation > "shop by collection" (second nav section).

  1. }
  2. .header-menu-nav-folder[data-folder="root"]>div>div {
  3.     margin-bottom: 22px !important;
  4. }

2) Can I change the nav left and right padding?

3) Can I align the ">" after the word all the way to the right padding?

Thanks!

Posted

@tuanphan Hi, I've added the hamburger to my desktop version but now my logo is on the left side. I want the hamburger on the left, logo in the middle, and book now/social icon on the right. Any idea what code I need to add or edit? Website > https://lemon-flower-srp5.squarespace.com/home

Current Code:

@media screen and (max-width: 5000px) {
  /* Display burger icon at all widths and align right */
  .header .header-burger {
    display: flex;
    order: 2 !important;
  }
  /* Make burger menu visible at all widths */
  .header--menu-open .header-menu {
    opacity: 1;
    visibility: visible;
  }
  /* Center logo in mobile device */
  .header-title {
    text-align: left !important;
  }
  /* Hide primary navigation menu */
  .header .header-title-nav-wrapper .header-nav {
    display: none;
  }
}.header-menu-nav-item {
  line-height: 3em
}
@media screen and (min-width: 900px) {
  .header-menu-nav-item a {
    font-size: 10vmin;
  }
}

Posted
On 8/11/2023 at 6:25 AM, tuanphan said:

#1. Use this CSS

div.container.header-menu-nav-item {
    margin-bottom: 30px !important;
}

#2. These padding?

image.png.3e41c32e5838c4fa75993349f2fa97b2.png

#3. Move all > touch red line?

image.png.9d2db5310303d5364da2a612de7eca2b.png

Yes

Posted
On 8/12/2023 at 5:07 AM, savvysocialite said:

@tuanphan Hi, I've added the hamburger to my desktop version but now my logo is on the left side. I want the hamburger on the left, logo in the middle, and book now/social icon on the right. Any idea what code I need to add or edit? Website > https://lemon-flower-srp5.squarespace.com/home

Current Code:

@media screen and (max-width: 5000px) {
  /* Display burger icon at all widths and align right */
  .header .header-burger {
    display: flex;
    order: 2 !important;
  }
  /* Make burger menu visible at all widths */
  .header--menu-open .header-menu {
    opacity: 1;
    visibility: visible;
  }
  /* Center logo in mobile device */
  .header-title {
    text-align: left !important;
  }
  /* Hide primary navigation menu */
  .header .header-title-nav-wrapper .header-nav {
    display: none;
  }
}.header-menu-nav-item {
  line-height: 3em
}
@media screen and (min-width: 900px) {
  .header-menu-nav-item a {
    font-size: 10vmin;
  }
}

Your site is private. Can you setup an access password? We can access easier

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted
On 8/10/2023 at 7:02 AM, vincenttodd said:

I've found a couple small issues I was wondering if you could help with:

1) I tried changing the navigation margins with the CSS below but it only changed the first nav section. i.g. https://www.toddagriscience.com navigation > "shop by collection" (second nav section).

  1. }
  2. .header-menu-nav-folder[data-folder="root"]>div>div {
  3.     margin-bottom: 22px !important;
  4. }

2) Can I change the nav left and right padding?

3) Can I align the ">" after the word all the way to the right padding?

Thanks!

To align >, use this CSS

.header-menu-nav-item-content {
    display: block !important;
}
span.chevron.chevron--right {
    float: right;
    margin-top: 8px;
}

image.png.3648e955322f214c9cc252668a73c0f7.png

With padding, use this

div.header-menu-nav-folder--active div.header-menu-nav-item a {
    margin-left: 0 !important;
}

 

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 4 weeks later...
Posted
On 9/7/2023 at 2:04 AM, savvysocialite said:

@tuanphan the site password is: fivestars

https://lemon-flower-srp5.squarespace.com/

I need the logo on desktop and mobile (it's off center now), the hamburger on the left, and the book now button on the right with social icon.

Hi,

Do this?

image.thumb.png.5419ea5e9e2d144f499044bcfe56de64.png

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted

Add this code to Website > Website Tools > Custom CSS

/* Header */
.header-display-desktop .header-burger {
    order: 1 !important;
}

.header-display-desktop .header-title-nav-wrapper {
    order: 2 !important;
}

.header-display-desktop .header-actions.header-actions--right {
    order: 3 !important;
}

.header-display-desktop .header-title-logo a {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
}

.header-display-desktop .header-announcement-bar-wrapper {
    padding-top: 4vw !important;
    padding-bottom: 4vw !important;
}

image.thumb.png.38451d756c6da450607729a2fdd1856e.png

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

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.