Jump to content

Custom Cart Icon in Mobile

Recommended Posts

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; 
}

 

 

Link to comment
  • Replies 5
  • Views 611
  • Created
  • Last Reply

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!)

Link to comment

add this code for mobile, you can adjust values

@media screen and (max-width:640px) {
.Mobile-bar .Cart .sqs-cart-quantity {
    margin-bottom: 9px;
    margin-left: 2px
}

.Mobile-bar .Cart {
    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!)

Link to comment

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.