A user needed to change the cart and drawer icons from grey to black (#000000) when scrolling past a transparent header on their Shopify theme. Changing the color scheme didn’t resolve the issue.
Attempted Solutions:
Adding custom CSS to password.liquid file (didn’t work)
Modifying theme.css/base.css with .header__icon selectors (caused unintended side effects—turned transparent header text black)
Using .scrolled-past-header class selectors (unsuccessful)
Working Solution:
Adding CSS code to theme.liquid file before the </head> tag successfully changed the icon colors to black when scrolling, without affecting the transparent header’s white text.
Status: Resolved. The user confirmed the final solution worked as intended.
Summarized with AI on October 27.
AI used: claude-sonnet-4-5-20250929.
I am currently working on a duplicated theme. I have a transparant header, but when I scroll the icon cart & drawer have a bit of a grey color. I want to change that color to #000000 (so completely black) can someone please help me? It’s a little adjustment. (Ps, changing color scheme doesn’t help)
Navigate to Online Store > Themes > click on Edit code.
Locate and open the theme.css or base.css file. Scroll to the bottom and add the following CSS code:
.header__icon--menu .icon {
color: black !important;
}
.header__icon, .header__icon--cart .icon {
color: black !important;
}
Hey, this unfortunetly also didnt work. When i added it to the custom css, it did work, but then the white text on the transparant header turned into black. is there maybe something else
The code is completely and it does works as well, can you double check if you added the code correctly? Maybe provide me a screenshot so that I can have a look too.
If my reply is helpful, kindly click like and mark it as an accepted solution.
Thanks!
Use our Big Bulk Discount app to boost your sales! (https://apps.shopify.com/big-bulk-discount). Easy to set up and perfect for attracting more customers with bulk discounts. Try it now and watch your revenue grow!