Jump to content

Change logo on hamburger menu

Recommended Posts

Site URL: https://www.psicodigitale.it/

Hello, I have a logo on my website that is white since the header background is of a dark colour (see image attached) but when I open the hamburger menu on mobile, the background becomes white and so my logo disappears (see second image attached).

I would like to substitute the bright logo with a dark one when I open the header menu on mobile. Note that the logo on my website is already been substitute with a custom css to add an svg instead of the png. This is the code that I'm currently using. Thank you all in advance. 

.header-title-logo img {
    visibility: hidden;
}
.header-title-logo a {
    background-image: url(https://static1.squarespace.com/static/60b1ecaf18ba745a54d1484d/t/61d2f9b0476ad24119bfebb3/1641216454121/Logo-Psicodigigitale-Colore.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
}

mobile 1.PNG

mobile 2 menu open.PNG

Edited by Nickss
Changed "header menu" with "hamburger menu"
Link to comment
  • Nickss changed the title to Change logo on hamburger menu
  • Replies 2
  • Views 509
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hey @Nickss try this

.header--menu-open { 
  .header-title-logo img {
    content: url("URL HERE") !important;
    max-height:inherit !important;
  }
}

 

SquareRefresh, premium plugins & templates that have an elevated feel.

Plugins: Have your site stand out. 
Templates: Our templates are designed with versatility in mind.
Get Freebies: Sometimes things in life are free. Browser our hand selected free plugins.

Link to comment

Hey thank you so much for this. Simply pasting your code didn't do the trick but I managed to make it work by coping and pasting my previous code inside the /header--menu-open{}. So to make it work now the whole code looks like this:

/*Make Squarespace Logo Invisible*/
.header-title-logo img {
    visibility: hidden;
}

/*Add my SVG logo*/
.header-title-logo a {
    background-image: url(https://static1.squarespace.com/static/60b1ecaf18ba745a54d1484d/t/61d2f9b0476ad24119bfebb3/1641216454121/Logo-Psicodigigitale-Colore.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
}

/*Add dark SVG logo on hamburger menu*/
.header--menu-open { 
	.header-title-logo a {
    background-image: url(https://static1.squarespace.com/static/60b1ecaf18ba745a54d1484d/t/61d2fa62c928c16903613f46/1641216632340/Logo-Psicodigitale-Dark-colorato.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
	}
}

 

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.