Shopify Development

Fixing Shopify Horizontal Scroll & Cart Drawer Clipping on Reformation Theme

Hey everyone, as a Shopify migration expert at Shopping Cart Mover, I spend a lot of time sifting through community discussions, and every now and then, a thread pops up that’s just gold. It showcases real-world problems and brilliant, collaborative solutions. Today, I want to unpack a recent discussion around a common, yet frustrating, issue: unexpected horizontal scrolling on mobile, specifically with the popular Reformation theme, and a related cart drawer clipping problem.

Shopify admin dashboard showing the custom CSS editor in Theme Settings.
Shopify admin dashboard showing the custom CSS editor in Theme Settings.

The "Urgent" Mobile Display Challenge

Our community member, siva_fds, brought up an "urgent" concern. They were seeing an annoying horizontal scroll on their product and collection pages when viewed on mobile, plus a "You may also like" heading in their cart drawer that was getting cut off. These kinds of display issues can really hurt user experience and even impact conversions, so getting them sorted quickly is key.

When tackling mobile display bugs, the first step is always diagnosis. DanielAnderson offered a fantastic initial tip: temporarily add

overflow-x: hidden;
to your main page wrapper. This acts as a quick test to see if the problem disappears, helping you pinpoint which section might be the culprit. Common offenders, as Daniel pointed out, often include newly added sections like recommended products, cart drawer content, or custom CSS rules that might use
width: 100vw
or excessive padding.

Unraveling the Cart Drawer Clipping Mystery

Now, let's dive into the specifics of siva_fds's store, Cordori.com.au. It turns out the cart drawer issue was a classic case of custom CSS clashing with theme defaults. Ploqo, another sharp community member, dug deep and found the root cause. Siva had a custom CSS rule in their Theme settings > Custom CSS:

.side-panel-content {padding: 10px;}
.

This seemingly innocent rule was creating a conflict. The Reformation theme's "You may also like" block is designed to break out of the drawer’s default 30px padding, using

width: calc(100% + 60px)
with
margin-left: -30px
. When the custom padding was reduced to 10px, the block ended up 20px wider than the drawer on each side, causing both edges to be clipped.

The Solution for Cart Drawer Clipping

Ploqo provided a precise CSS snippet to resolve this, ensuring the recommendations block aligns perfectly with the adjusted padding:

@media (max-width: 1067px) {
  .cart-drawer .cart-drawer--recommendations--container {
    width: auto;
    margin-left: -10px;
    margin-right: -10px;
  }
}

Let's break down why this works:

  • width: auto;
    : Resets the width calculation, allowing the element to determine its own width based on its content and parent.
  • margin-left: -10px;
    and
    margin-right: -10px;
    : These values directly counteract the custom
    10px
    padding applied to
    .side-panel-content
    , effectively pulling the recommendations container to the edges of the drawer. Crucially, these values must match your
    .side-panel-content
    padding.
  • @media (max-width: 1067px)
    : This media query is vital. It ensures the fix only applies to smaller screens (mobile and tablet views) where the cart drawer is active. Above 1068px, the Reformation theme often displays this block as a different side panel, and applying these rules universally could break the desktop layout.

While another community member, Laza_Binaery, suggested adding

margin-left: 15px;
to
.cart-drawer--recommendations
, Ploqo's solution directly addresses the theme's specific layout mechanics and the custom padding conflict, offering a more robust and precise fix for this particular theme behavior.

Eliminating Horizontal Scroll on Product Pages

The second part of the puzzle was the horizontal scroll on product pages. This was traced back to the product recommendations row, which was slightly wider than its containing section on mobile, leading to the unwanted scroll.

The Solution for Product Page Scroll

Ploqo again provided an elegant solution that removes the scroll at its source, rather than just hiding it with

overflow: hidden
(which Laza_Binaery initially suggested as a temporary measure).

@media (max-width: 767px) {
  .product-recommendations.swipe-on-mobile .products.row {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

Here's what this CSS does:

  • @media (max-width: 767px)
    : This media query targets typical mobile screen sizes.
  • width: 100%;
    : Ensures the recommendations row takes up the full width of its parent container, preventing it from overflowing.
  • margin-left: 0;
    and
    margin-right: 0;
    : Removes any default or inherited margins that might be pushing the element out of bounds.

This fix ensures the product recommendations row fits perfectly within its section on mobile, eliminating the horizontal scroll while preserving the swipe carousel functionality that users expect.

Key Takeaways for Shopify Merchants

This case study highlights several critical lessons for anyone managing a Shopify store, especially when dealing with theme customizations:

  1. Test Thoroughly on All Devices: What looks perfect on desktop might break on mobile. Always check your site on various screen sizes and devices.
  2. Understand Theme Defaults: Before adding custom CSS, try to understand how your theme (like Reformation) handles specific elements. Custom rules can easily conflict with built-in styling.
  3. Use Media Queries Wisely: Responsive design is key. Media queries allow you to apply styles only when needed, preventing unintended side effects on other screen sizes.
  4. Seek Community Help: The Shopify Community forums are a goldmine of information and expert advice. Don't hesitate to post your issues.
  5. When in Doubt, Consult an Expert: Complex CSS conflicts or persistent display bugs can be tricky. If you're not comfortable diving into code, a Shopify development expert can quickly diagnose and fix issues, saving you time and potential headaches.

Ensuring a smooth, responsive shopping experience is paramount for customer satisfaction and conversions. If you're looking to start your own online store or migrate to a more robust platform, consider the power and flexibility of Shopify for your e-commerce journey. And remember, for complex migrations or custom development needs, the Shopping Cart Mover Team is always here to help you optimize your Shopify store for peak performance.

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases