Shopify themes, liquid, logos, and UX
I really want to smoothly hide my logo when the hamburger menu is opened. Got inspired by apple.com mobile website version drawer menu and would love to make something similar!!
Theme - Dawn
Huge thanks in advance!
Solved! Go to the solution
This is an accepted solution.
The code only call the logo not the icons.
we can change into visibility like this not the display none.
@media only screen and (max-width: 749px){
header.header:has(.menu-drawer-container[open]) a.header__heading-link {
visibility: hidden !important;
}
}
And Save.
What the code is saying is that when the menu drawer in the header is open, the logo will be hidden.
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Hi @Apeya , kindly provide your store URL please and if it is password protected, please share the password as well. Thanks
1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file and paste the below code before </body>
<script>
const hamburger = document.querySelector('.menu-drawer-container');
const logo = document.querySelector('.header__heading-logo-wrapper');
hamburger.addEventListener('click', function() {
if (hamburger.hasAttribute('open')) {
logo.style.opacity = '1';
} else {
logo.style.opacity = '0';
}
});
</script>
If my reply is helpful, kindly click like and mark it as an accepted solution.
If you are happy with my help, you can help me buy a COFFEE
Thanks!
Thank you for provided solution, but unfortunately it didn't work(
The logo is still visible after opening the hamburger menu //Maybe you have any other ideas how to solve it?
thanks
Hi @Apeya
Try this one.
<style>
@media only screen and (max-width: 749px){
header.header:has(.menu-drawer-container[open]).header__heading {
display: none;
}
}
</style>
Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!
Hi,
Just tried your variant and it doesn't work either. Logo stays in the way it was before...
Still thanks, hopefully someone finds a way out!
Please, try this again.
<style>
@media only screen and (max-width: 749px){
header.header:has(.menu-drawer-container[open]) h1.header__heading {
display: none !important;
}
}
</style>
And Save.
Same Instruction.
Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!
Sorry, couldn't upload the video, but here is a link to my google drive where you can check the foresaid issue:
Thanks
https://drive.google.com/file/d/1f3Z7GGO7uCyv59z62SYV17ZO0QcGc-ta/view?usp=sharing
change the code with this one,
@media only screen and (max-width: 749px){
header.header:has(.menu-drawer-container[open]) a.header__heading-link {
display: none !important;
}
}
and save.
For your icons, you need a developer to check that one.
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Everything works!
About icons - I believe this code acts as a trigger for 'shake' issue, because I didn't have such problem before pasting the code(
Maybe we can try to fade out header icons, not just covering them with burger menu drawer?
If you can't help me with this one, I will mark the previous code as a correct solution//
Thank you!!
This is an accepted solution.
The code only call the logo not the icons.
we can change into visibility like this not the display none.
@media only screen and (max-width: 749px){
header.header:has(.menu-drawer-container[open]) a.header__heading-link {
visibility: hidden !important;
}
}
And Save.
What the code is saying is that when the menu drawer in the header is open, the logo will be hidden.
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Yess, the icons stopped moving with this code.
Highly appreciate your work, Mr Made4uo-Ribe xD
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024