I’m trying to make a transparent header in my shopify homepage which becomes white on scroll. I’m using GemPages so I’ve tried adding custom HTML into the app.
Right now the code looks like this:
{% if template == ‘index’ %}
.section-header .header-wrapper { background: rgba(0, 0, 0, 0) !important; /* Full transparency */ background-image: none !important; } body .section-header.color-scheme-3 .header-wrapper { background-color: transparent !important; } .section-header .header__icon .svg-wrapper, .section-header header .header__menu-item span { color: #fff !important; } .section-header .header__heading-logo { filter: invert(1) !important; } .section-header .header-wrapper--border-bottom { border-bottom: none !important; /* Hide border when transparent */ } html .section-header.scrolled-past-header .header-wrapper { background-color: #fff !important; } html .section-header.scrolled-past-header .header__icon .svg-wrapper, html .section-header.scrolled-past-header header .header__menu-item span { color: #141414 !important; } html .section-header.scrolled-past-header .header__heading-logo { filter: invert(0) !important; } html .section-header.scrolled-past-header .header-wrapper--border-bottom { border-bottom: 1px solid #e0e0e0 !important; } #MainContent { margin-top: -66px; } @media (max-width: 749px) { .section-header .header__icon--menu .icon { color: #fff !important; } html .section-header.scrolled-past-header .header__icon--menu .icon { color: #141414 !important; } html #shopify-section-sections--22799632531782__header header { background-color: transparent !important; } html #MainContent { margin-top: -63px; } }{% endif %}
The problem is that by some reason the header is still white with white text by deafult and then it transitions into white header with black text on scroll. In between the transition the header is transparent but just for a second or so. How can I fix it? The website is stridedrinks.com
