Mastering Your Shopify Cart Drawer: How to Harmonize Button Sizes and Spacing
Hey there, fellow store owners! Let's talk about those crucial moments in your customer's journey: the cart and checkout. We all know how important a smooth, consistent experience is, especially when it comes to getting customers across the finish line. Recently, a great discussion popped up in the Shopify community that really highlights a common pain point: getting those cart drawer buttons to play nice and look uniform. It’s a small detail, but it can make a big difference in how polished and trustworthy your store feels.
The original post came from @siva_fds, who was grappling with button sizing in their Shopify premium theme’s cart drawer. Specifically, the "Add to Cart" button was a bit larger than the "Buy Now" button, creating an inconsistent look. If you've ever felt that slight visual imbalance on your own store, you know exactly what I'm talking about. It just feels... off.
Take a look at what siva_fds was seeing:

The Community Jumps In: Multiple Angles to a Common Problem
What I love about the Shopify community is how quickly everyone jumps in with different solutions, often tackling the problem from slightly different angles. This thread was a fantastic example of that collaborative spirit.
Simple Margin Adjustments for Spacing
The first few suggestions focused on evening out the spacing between the buttons, which often contributes to the visual imbalance. @devcoders offered a concise CSS snippet:
.cart__ctas>*+* {
margin-top: 0!important;
}
This code targets the direct siblings within the cart's call-to-action area, effectively removing extra top margin. Here's what that might look like:

Then, @tim_tairli chimed in with an even simpler approach to clear margins:
.cart__ctas > * {
margin: 0;
}
This snippet applies a zero margin to all direct children within the `.cart__ctas` container. Tim even provided helpful before-and-after visuals:
Before:

After:

The Comprehensive Solution: Button Normalization
While margin adjustments are helpful for spacing, the core issue of inconsistent *sizing* often requires a bit more. This is where @Wsp stepped in with a much more comprehensive set of CSS rules. Wsp's approach focuses on normalizing various button properties within the cart drawer, ensuring they all adopt a consistent look and feel.
- Cart Drawer Scoped Normalization: This code targets all relevant buttons within the `.cart-drawer` and sets their width, minimum height, padding, font size, and display properties to be consistent.
- Fix ONLY Dynamic Checkout Button: Dynamic checkout buttons (like PayPal or Shop Pay) often have their own unique styling. This snippet specifically targets them to ensure their height and border-radius match the other buttons.
- Fix Spacing Safely (Theme-Independent): Finally, to ensure consistent spacing between these harmonized buttons, Wsp adds a margin-top rule.
.cart-drawer button,
.cart-drawer .button,
.cart-drawer a.button,
.cart-drawer .shopify-payment-button__button {
width: 100% !important;
min-height: 48px !important;
padding: 14px 16px !important;
font-size: 16px !important;
line-height: 1 !important;
display: flex !important;
align-items: center !important;
justify-content: center !important;
box-sizing: border-box !important;
}
.cart-drawer .shopify-payment-button__button {
min-height: 48px !important;
border-radius: 6px !important;
}
.cart-drawer .button + .button,
.cart-drawer .shopify-payment-button {
margin-top: 12px !important;
}
A Mobile-Specific Consideration
And let's not forget mobile! @Mustafa_Ali offered a solution specifically for smaller screens, which is a great reminder that responsive design is key. This code snippet targets a specific button class on screens up to 767px wide:
Mustafa also included an image, likely showing the mobile view after applying the fix:

Putting It All Together: Your Step-by-Step Guide to Harmonized Cart Buttons
Based on these excellent community contributions, here's how you can tackle button inconsistencies in your Shopify cart drawer, focusing on Wsp's comprehensive approach as a primary solution, and considering others as needed.
Before You Start: Safety First!
Always, always, back up your theme before making any code changes. Go to Online Store > Themes > Actions > Duplicate. This way, if anything goes awry, you can easily revert.
Adding the Custom CSS
The best place for these CSS changes is either in your theme's dedicated CSS file (like base.css or theme.css) or, for simpler additions, directly in the Custom CSS section of your theme editor.
- Navigate to Your Theme Code:
- From your Shopify Admin, go to
Online Store > Themes. - Find the theme you want to edit (ideally, a duplicate theme or the one you're actively building).
- Click
Actions > Edit code.
- From your Shopify Admin, go to
- Choose Your CSS File:
- In the left-hand sidebar, under the
Assetsfolder, look for files likebase.css,theme.css, orcustom.css. Select the most appropriate one (base.cssis a common choice). - Alternatively, you can go to
Online Store > Themes > Customize, then click the cog icon (Theme Settings) in the bottom left, and findCustom CSS. This is often the easiest for small snippets.
- In the left-hand sidebar, under the
- Paste the Comprehensive CSS:
Scroll to the very bottom of your chosen CSS file (or the Custom CSS box) and paste the following code from Wsp. This will normalize the general button styling, fix dynamic checkout buttons, and ensure consistent spacing.
/* Cart Drawer Button Normalization (Wsp's Solution) */ .cart-drawer button, .cart-drawer .button, .cart-drawer a.button, .cart-drawer .shopify-payment-button__button { width: 100% !important; min-height: 48px !important; padding: 14px 16px !important; font-size: 16px !important; line-height: 1 !important; display: flex !important; align-items: center !important; justify-content: center !important; box-sizing: border-box !important; } .cart-drawer .shopify-payment-button__button { min-height: 48px !important; border-radius: 6px !important; } .cart-drawer .button + .button, .cart-drawer .shopify-payment-button { margin-top: 12px !important; } - Consider Mobile-Specific Adjustments (Optional):
If, after applying the above, you still notice inconsistencies on mobile, you might consider Mustafa_Ali's suggestion. However, I'd recommend adding it to your CSS file (e.g.,
base.css) within an@mediaquery, rather than directly intheme.liquid, for better organization. If you must usetheme.liquid, place it just before the