storefront
storefront copied to clipboard
Allow styling of cart (mobile item count icon) based on empty/full state or number of items
My suggestion is to add a data attribute, e.g. data-count
, to this tag to allow easy conditional styling when 1 or more item has been added to cart.
https://github.com/woocommerce/storefront/blob/d5266033f55f13c64d7eaa6935cf4ab926e6ef1b/inc/woocommerce/storefront-woocommerce-template-functions.php#L683
Example
@uok can you please elaborate a bit further? I believe the styling of the count icon is already possible:
/* Changes the color of the cart count of the handheld menu cart item on mobile devices */
.storefront-handheld-footer-bar ul li.cart .count {
background-color: red;
}
Result:
the idea was to have another color for the count, once an item has been added to cart. 0 = black, 1 or more e.g. orange
the idea was to have another color for the count, once an item has been added to cart. 0 = black, 1 or more e.g. orange
I see, so you would like to style the cart count differently depending on the number of items? To clarify this I've retitled the issue and tagged this as Enhancement
.