Cart styles
The CSS classes for each UI component that provides the cart drop-in component with its UI are provided here. Override these classes and add new classes to customize the look and feel of your cart to match your specific style requirements.
Customizing your cart styles
The quickest way to override the cart CSS is to inspect the cart UI from your browser’s developer tools.
- Inspect the element in the UI that you want to customize (right-click on the element and select “Inspect” from the menu).
- Identify the CSS class(es) for the element. We use BEM naming, which makes it easy to know which component you’re changing (and which CSS file to use). This class styles the
Cart
component, so use yourcart.css
file. - Copy the CSS class to your
cart.css
file to override the existing rules or add new rules to the class. But wait! Look closely 🧐 at the.cart-cart__heading
class. It’s using two design tokens. And when you see a design token within a CSS rule, don’t remove the token. Instead, change the token’s value (where it’s defined) OR create a new token along-side this existing one to ensure maintenance and updates continue to benefit from global design token usage.
Example CSS overrides
Here’s an example of adding CSS class overrides to your cart.css
file:
Cart component CSS
The CSS classes for each cart component are provided here.
cart.css
empty-cart.css
mini-cart.css
Summary
You can customize the cart by overriding the CSS classes provided for each component. Create a CSS file for each component to make it easier to maintain and update your cart CSS. Use the BEM naming convention and your browser’s dev tools to identify and copy the class to your corresponding component CSS file and override it as needed. Happy styling! 🎨