We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Cart changes color when it has items added.

Cart changes color when it has items added.

Stateofmind_
Tourist
14 0 5

My shopping cart behaves exactly as i want it to when it's empty. On the homepage the header is overlayed, so it's displayed as white together with the logo & main menu. And when i go to any other page, it changes color to grey along with the black logo & main menu in header. 

 

When an item it added to the cart however, it stops "changing" color when leaving the home page for another page on the site. It stays white, and appears almost invisible. 

 

Note that i have added this code with help from a developer here in the community :

 

 <style>
.cart-has-items .site-nav__link--cart.site-nav__link--cart {
background-color: transparent !important;
}
</style>

 

But even when removing this snippet the problem still remains. Please help with resolving this. 

 

Thanks!

 

Link: https://vrf9b0ylvgzvnfpd-55008723125.shopifypreview.com

 

Screenshot 2024-12-02 at 12.47.14.pngScreenshot 2024-12-02 at 12.47.34.png

 

Screenshot 2024-12-02 at 12.48.13.pngScreenshot 2024-12-02 at 12.48.05.png

  

Reply 1 (1)

theycallmemakka
Shopify Partner
1813 440 474

Hi @Stateofmind_ ,

 

I have written custom CSS for this solution. Please follow below steps and let me know your feedback.

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find theme.liquid file

4) Add the following code just above tag </body>

<style>
html:not(:has(.template-index.cart-has-items)) .site-nav__link--cart.site-nav__link--cart {
    color: var(--colorNavText)!important;
}
html:not(:has(.template-index.cart-has-items)) span.cart-link__bubble-num {
    color: #fff;
}
</style>

theycallmemakka_0-1733220148529.png

 

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

 

Best Regards,
Makka

Support Me: Buy me a Coffee


For quick response - Message Me


Ping me at: theycallmemakka@gmail.com