Jump to content

Custom Cart Icon in Mobile

Recommended Posts

Posted

Site URL: http://www.palmettehome.com

Hi,

 

I have a custom bag icon and it works great on desktop. I need to also show the same custom bag icon on mobile. Currently, the original bag icon is showing in mobile, not my custom icon. I think I need to include a media query but can't get it to work. Here is the code I'm using right now:

 

.tweak-header-cart-style-bag .Header .Cart>* {
    visibility: hidden !important;
}
.tweak-header-cart-style-bag .Header .Cart .sqs-cart-quantity {
    visibility: visible !important;
    margin-bottom: 9px;
    margin-left: 2px;
}
.tweak-header-cart-style-bag .Header .Cart {
    background-image: url(IMAGE URL HERE);
    background-size: cover;
    background-repeat: no-repeat;
    width: 35px; 
    height: 35px; 
}

 

 

  • Replies 5
  • Views 720
  • Created
  • Last Reply
Posted

Edit your code to

.tweak-header-cart-style-bag .Header .Cart>*, .Mobile-bar .Cart>* {
    visibility: hidden !important
}

.tweak-header-cart-style-bag .Header .Cart .sqs-cart-quantity, .Mobile-bar .Cart .sqs-cart-quantity {
    visibility: visible !important;
    margin-bottom: 9px;
    margin-left: 2px
}

.tweak-header-cart-style-bag .Header .Cart, .Mobile-bar .Cart {
    background-image: url(https://static1.squarespace.com/static/5db70be950a9242bc19ec39e/t/5f455cb90556a5623a04be4c/1598381242067/Tote_Bag_Icon.png);
    background-size: cover;
    background-repeat: no-repeat;
    width: 35px;
    height: 35px
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Posted

Great!

Last question would be, can I change the margins for .sqs-cart-quantity for mobile? so I have one set of margins for desktop and one for mobile? I'm seeing now that the quantity is off center on mobile if I have the margins set for desktop viewing.

 

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.