Jump to content

Remove language switcher when mobile menu is closed

Recommended Posts

Site URL: https://bear-clarinet-ghhl.squarespace.com/

Hi all,

I set up a language switcher for my site using the bradgood tutorial. However I am stuck with the styling for mobile view. 

As the language switcher is overlapping my mobile site title, I want to remove it when the mobile menu is closed, and that the switcher only appears when the mobile menu is open. 

Can someone help me to remove the switcher when the mobile menu is closed?

password: elise

@media @mobile {
  .language {
  color: #fff;
  opacity:1;
  position: absolute;
  top: 1.5em;
  right: 7.5em;
  z-index: 99999;
  font-weight: 100px;
  font-size: 1.2em;
  font-family: 'p22-underground';
  a {
    color: hsl(23,37%,95%);
    &:hover {
      opacity: 0.8;
    }
  }
}
}

 

Link to comment
  • Replies 3
  • Views 208
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

13 hours ago, tuanphan said:

Add to Design > Custom CSS

body:not(.header--menu-open) .language {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
}

 

Thanks a lot for this. 

One more thing however, since I have a 'scroll back' header option the language switcher doesn't show when I open the mobile menu from another section (it only shows when the menu is opened from the first section). 

How can I make the language switcher always appear in the mobile menu? 

 

Link to comment
20 hours ago, Elise__ said:

Thanks a lot for this. 

One more thing however, since I have a 'scroll back' header option the language switcher doesn't show when I open the mobile menu from another section (it only shows when the menu is opened from the first section). 

How can I make the language switcher always appear in the mobile menu? 

 

try this new code

body:not(.header--menu-open) header#header:not(.shrink) .language {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !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!)

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.