Hello,
I have a new site that I am using the Dawn Theme. The Sticky header is enabled but the logo takes up a considerable amount of space. How would I go about collapsing the logo on scroll down to only show the Navigation element?
Thank you in advance.
Bryan
1 Like
Hi @EvolvedGame
Can you kindly share your store link (with the password, if any) with us? We will check it and suggest you a solution if possible.
Hi @EvolvedGame
It has the option to reduce logo when scrolling down in Online Store > Themes > Customize
Thank you everyone for reaching out. I was able to resolve this issue by using a combination of CSS and JavaScript.
These are the steps I used to collapse the logo:
Add CSS (in base.css)
Go to Online Store → Themes → Edit Code → Open assets/base.css and add this at the bottom:
.header__heading-logo {
transition: opacity 0.3s ease-in-out;
}
.header–scrolled .header__heading-logo {
opacity: 0;
visibility: hidden;
}
/* Ensure the header collapses smoothly */
.header {
transition: all 0.3s ease-in-out;
}
/* Shrink header on scroll /
.header–scrolled {
height: 50px; / Adjust based on your design */
padding: 5px 0;
display: flex;
}
/* Adjust navigation size when scrolling */
.header__inline-menu {
transition: all 0.3s ease-in-out;
}
.header–scrolled .header__inline-menu {
margin-top: -10px;
}
Add JavaScript (in theme.liquid before )
Open layout/theme.liquid, scroll to the bottom, and add this right before :