Jump to content

swap out logo image (png) for mobile overlay menu

Go to solution Solved by tuanphan,

Recommended Posts

Site URL: https://www.soulslicepizza.com

I'm using a dark theme for the overlay mobile menu, which means I have a lighter logo version I'd like to swap out when the menu is open. I've uploaded a lighter version of the logo for this purpose.

I'm using the following css

@media screen and (max-width:767px) {
  .header--menu-open .header-title-logo a {
  background-image: url('https://static1.squarespace.com/static/5fc6fe0f791da6493f67c762/t/6020a88d5714ae7f74a1debe/1612753037570/logo+-+reverse.png');
  background-size: cover;
  background-repeat: no-repeat;
  }
}

 

110040518_ScreenShot2021-02-07at9_38_26PM.thumb.png.f085e7a3a2d5fb049319e43f20e1fdfd.png

what I notice is it does not swap the current logo, but seems to be positioned behind it instead. Is there another line of css I'm missing here? Is there a div i need to set an opacity value on?

Edited by MM_CA
Link to comment
  • Solution

try this code

@media screen and (max-width:767px) {
  .header--menu-open .header-title-logo a {
  background-image: url('https://static1.squarespace.com/static/5fc6fe0f791da6493f67c762/t/6020a88d5714ae7f74a1debe/1612753037570/logo+-+reverse.png');
  background-size: cover;
  background-repeat: no-repeat;
  }
 .header--menu-open .header-title-logo img {
	visibility: hidden;
}
}

 

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
  • 1 year later...
On 2/8/2021 at 6:38 AM, tuanphan said:

try this code

@media screen and (max-width:767px) {
  .header--menu-open .header-title-logo a {
  background-image: url('https://static1.squarespace.com/static/5fc6fe0f791da6493f67c762/t/6020a88d5714ae7f74a1debe/1612753037570/logo+-+reverse.png');
  background-size: cover;
  background-repeat: no-repeat;
  }
 .header--menu-open .header-title-logo img {
	visibility: hidden;
}
}

 

This worked a treat for swapping out my logo when the menu is open. Thank you for posting it. 🙂

Sayre

(I'm supposed to be writing probably, but here I am 🤣)

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.