A user working with Shopify’s Studio or Dawn theme wants to hide their brand logo in the sticky header when scrolling, while keeping the menu and icons visible. The large logo takes up too much screen space during scroll.
Initial Problem:
Logo remains visible in sticky header when scrolling
Previous code solutions caused menu titles to break
Issue initially only worked on homepage, not other pages
Solution Process:
Community members provided CSS code targeting the .header__heading element
Code uses transform: scale(0) and height: 0 to hide logo when .scrolled-past-header class is active
Initial implementation only worked on front page
Required adding code to a global template file (Assets/base.css) to apply across all pages
Final Resolution:
The user shared complete working CSS code that successfully hides the logo on scroll across all pages. The solution includes transitions for smooth animation, media queries for desktop responsiveness, and adjustments to prevent layout shifts when logo disappears.
Summarized with AI on October 30.
AI used: claude-sonnet-4-5-20250929.
We are using the sticky header but our brand’s logo takes up too much space of the screen when scrolling. Is it possible to somehow hide the logo when the menu bar isn’t at the top of the page? To just keep the menu bar and the icons when scrolling?
Images:
1. What it looks like and what we want it to look like at the top of the page
We tried using a code from this post, but unfortunately it didn’t quite work for us. The menu titles and icons moved slightly to the left instead of staying in place when scrolling and the mega menu didn’t work properly unless it was at the top of the page. (see video of our website when using that code)
It’s hard to tell, because the sticky menu doesn’t appear to be enabled right now, so I cannot give you an updated code for you to use. I saw what you mean in your video. Would it be possible for you to enable the sticky header so the Community can look at it and advise?
We’re in the middle of updating and changing the theme for our website so the new theme that we’re working on right now is not the same as what we currently have online. But here is a link to a preview of the new theme in case that helps: https://vks98zj89zpfra1k-18324013.shopifypreview.com
Aha! Now I can see the sticky header on the preview link. Thank you.
Here is the code you need to hide your Logo on scroll and still be able to use the navigation without breaking it.
I tested it and I can see it working, although it is just a test through the front-end so it is not super clean and smooth as when you implement it from your code. I made a video but would’t let me attach it here.
It works perfectly on our front page but is not working on any other page. Is there any way to fix this so that the logo disappears when scrolling on all pages and not just the front page? Thank you so so much!
Hi! Thank you so so much for taking a look at this!
It works perfectly on our front page but is not working on any other page. Is there any way to fix this so that the logo disappears when scrolling on all pages and not just the front page? Thank you so much!