Shopify CSS Fix: Taming AI-Generated Sections for Perfect Mobile Display

Hey store owners! As a Shopify expert who spends a lot of time digging through community discussions, I often come across fascinating challenges that highlight the ever-evolving landscape of e-commerce design. One recent thread caught my eye, focusing on a store owner, whimandwise, who was wrestling with some tricky CSS issues in a custom, AI-generated section on their Shopify store. It's a perfect example of how powerful AI tools like Sidekick can be, but also how sometimes, you just need a human touch (and a little custom CSS) to get things pixel-perfect.

The core of the problem revolved around two main bugs that were messing with the mobile experience:

  • Bug 1: The left panel content was getting clipped at the top on mobile. Imagine a beautiful product image or headline just getting cut off – not ideal for conversions!
  • Bug 2: Carousel navigation dots were obscuring the product title on the right panel. Again, a frustrating user experience that makes it hard to see product details.

Let's dive into what the community uncovered and how we can tackle these kinds of issues.

The Mobile Clipping Head-Scratcher: Taming the Left Panel

It's a classic mobile optimization dilemma: content that looks great on desktop suddenly misbehaves on smaller screens. Whimandwise initially suspected max-height or overflow: hidden, which are common culprits. But as the community experts jumped in, a clearer picture emerged.

What the Community Found

Our eagle-eyed community member, lumine, quickly identified a key factor: justify-content: center on the left panel. On mobile, this was vertically centering the content. If the content stack was taller than the panel could naturally size to (especially with a tricky background image fighting for height), the headline would get pushed right off the top edge. Another contributor, tim_1, offered a solution involving padding-top to push the content down, and object-position: top for the image to ensure it aligned correctly.

The Recommended Fix for Left Panel Clipping

Based on these insights, here's a robust solution to prevent that frustrating mobile clipping. We'll combine the best of the community's suggestions:

The first step is to target the specific section on mobile. We'll use a media query to ensure these changes only apply to screens smaller than 750px (a common breakpoint for mobile devices).

CSS for Left Panel:

@media screen and (max-width: 749px) {
  /* Target the left panel. Using a partial class selector for robustness. */
  [class^="ai-top-hits-left-panel"] {
    justify-content: flex-start; /* Align content to the top, not center */
    min-height: 360px; /* Ensure enough minimum height to prevent clipping */
    padding-top: 35vw; /* Add top padding to create space, adjust as needed */
  }

  /* Ensure images within the left panel are positioned correctly */
  [class^="ai-top-hits-left-panel"] img {
    object-position: top;
  }

  /* If max-height or overflow: hidden is explicitly set elsewhere, override it */
  .left-panel-selector { /* You might need to inspect your exact class name here */
    max-height: none;
    overflow: unset;
  }
}

Here are the visual results that tim_1 provided from their fix:

Screenshot 2026-05-05 at 2.55.39 PM

Those Pesky Carousel Dots: Fixing the Right Panel Overlap

Next up was the issue of carousel navigation dots sitting right on top of the product title. This usually happens when elements are absolutely positioned, taking them out of the normal document flow and causing them to ignore other content.

What the Community Found

Laza_Binaery correctly pointed out that the dots likely needed to be in normal document flow (not position: absolute) and positioned below the product title. Tim_1's suggestion of padding-bottom: 20px; for the product name was a good way to create space, even if it didn't directly address the dots' positioning.

The Recommended Fix for Carousel Dots

To get those dots in their proper place and give them some breathing room, we'll adjust their positioning and add a little padding:

CSS for Right Panel & Carousel Dots:

/* Add padding below the product name to create space */
[class^="ai-top-hits-product-name"] {
  padding-bottom: 20px;
}

/* Target the carousel dots to ensure they are in normal flow and spaced correctly */
.dots { /* You might need to inspect your exact class name for the dots here */
  padding-top: 8px;
  position: relative; /* Brings them back into the document flow if they were absolute */
}

And here's another example image from tim_1 showing improvements:

Screenshot 2026-05-05 at 2.50.37 PM

A Critical Note on AI-Generated Section Quirks & Hashed Classes

This discussion brought up a really important point from lumine: when you're working with custom sections, especially those generated by AI tools or dynamic builders, you might encounter hashed class names. Lumine gave an example like .ai-top-hits-left-panel-auxpmd0juwhpzzfdxoaigenblockdba7094lqfyx7. The problem? These suffixes (auxpmd0juwhpzzfdxoaigenblockdba7094lqfyx7 in this case) can regenerate and change if you edit the block, breaking your custom CSS! This is why using a partial selector like [class^="ai-top-hits-left-panel"] (as suggested by tim_1) is often a much safer bet, as it targets any class that *starts with* ai-top-hits-left-panel, regardless of the unique hash.

Always try to give your wrapper elements stable, custom classes if you can, or rely on these partial attribute selectors for more resilient CSS.

How to Implement These Fixes in Your Shopify Store

Ready to apply these tweaks? Here's how you can add custom CSS to your Shopify theme:

  1. Go to your Shopify Admin: Log in to your store's backend.
  2. Navigate to Themes: From the left sidebar, go to Online Store > Themes.
  3. Edit Your Theme: Find the theme you want to edit (ideally, duplicate your live theme first so you're not making changes directly to your live site!). Click Actions > Edit code.
  4. Find Your CSS File: In the theme editor, look for a file like theme.css, base.css, or custom.css, usually under the 'Assets' folder. If your theme has a dedicated 'Custom CSS' section within the theme editor (sometimes found under Theme Settings or specific section settings), that's even better!
  5. Add the CSS: Paste the combined CSS code provided above into the chosen CSS file. Make sure to update .dots or .left-panel-selector with the correct class names from your store by using your browser's 'Inspect' tool (right-click on the element > Inspect).
  6. Save and Test: Click 'Save' and then immediately check your store on different mobile devices and screen sizes to ensure the fixes are working as expected and haven't introduced any new issues.

It's always a good reminder that while AI tools are incredible for speeding up design, they don't always account for every edge case or responsive nuance. The power of the Shopify community really shines through in these situations, where collective expertise can pinpoint exact causes and provide practical, tested solutions. Don't hesitate to poke around with your browser's inspector tool, and if you get stuck, the community is always there to lend a hand!

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools