All things Shopify and commerce
I would like my header to be transparent with white text on my homepage. On scroll it should then transfrom into white header with black text. I'm using a Shopify theme - Refresh. I've tried adding css and java script before but it didn't work properly.
it's stridedrinks.com
Hello @stride Try out the steps and code in the marked reply here https://community.shopify.com/c/shopify-design/how-can-i-create-a-transparent-header-on-the-refresh-...
this should be able to make your header transparent as you’d like.
Hi @stride
Please add this code to theme.liquid file, after <head> in Online Store > Themes > Edit theme
{% if template == 'index' %}
<style>
.section-header .header-wrapper {
background: transparent;
}
.section-header .header__icon .svg-wrapper,
.section-header header .header__menu-item span {
color: #fff;
}
.section-header .header__heading-logo {
filter: invert(1);
}
html .section-header.scrolled-past-header .header-wrapper {
background: #fff;
}
html .section-header.scrolled-past-header .header__icon .svg-wrapper,
html .section-header.scrolled-past-header header .header__menu-item span {
color: #141414;
}
html .section-header.scrolled-past-header .header__heading-logo {
filter: invert(0);
}
#MainContent { margin-top: -66px; }
@media (max-width:749px) {
.section-header .header__icon--menu .icon {
color: #fff;
}
html .section-header.scrolled-past-header .header__icon--menu .icon {
color: #141414;
}
html #shopify-section-sections--22799632531782__header header {
background-color: transparent;
}
html #MainContent {
margin-top: -63px;
}
}
</style>
{% endif %}
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Amazon Products Importer - Import Amazon Products to Dropship in Your Store!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Hi! Thanks for the help, I've tried adding the code as you said but it's still not working. The photos you sent are a perfect example of how it should work though.
Where did you add the code? Did you save file after adding code?
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Amazon Products Importer - Import Amazon Products to Dropship in Your Store!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Yes, i've saved it. I've added it like this
Hi, cannot see the code in the HTML of your site. Make sure you added code to theme.liquid file of the current theme.
- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Amazon Products Importer - Import Amazon Products to Dropship in Your Store!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...Sign up now.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025