I would like to know if the header can turn white again when I scroll down.
Grateful for any help, thank you!
Hi @k3k3k3
Welcome to the Shopify Community! Please share your store URL and password (if it’s password-protected), so I can check and provide you with the exact solution.
Best regards,
Devcoder ![]()
Use this code in Theme settings-> Custom CSS:
.scrolled-past-header sticky-header {
background: rgb(var(--color-background));
}
sticky-header {
transition: background 0.3s linear;
}
May also try this – will also restore background if header is hovered over or has a drop-down open:
.scrolled-past-header sticky-header, /* when scrolled */
sticky-header:hover, /* when hovered */
sticky-header:has(.header__menu-item[aria-expanded="true"]) { /* when drop-down is open */
background: rgb(var(--color-background)); /* reset background */
}
sticky-header {
transition: background 0.3s linear;
}