Taming Your Shopify Mobile Menu: Fixing Font Sizes & Underlines After Theme Updates

Hey there, fellow store owners! It’s me, your friendly Shopify migration expert and community analyst, back with another gem from the forums. I love diving into the real-world challenges you face, and recently, a thread about mobile menu headers caught my eye. It’s a classic scenario: you’ve got your site looking perfect on desktop, but then you check your phone, and BAM! Something’s just not right. This time, it was all about mobile menu font sizes and missing underlines, a common headache that can really impact your customer’s mobile experience.

When Your Mobile Menu Goes Rogue: Geronim0's Dilemma

Our community member, Geronim0, kicked off the discussion with a problem many of us can relate to. They had carefully crafted custom CSS to control the size and styling (like underlining) of their header menu and sub-menus. Everything was working beautifully on desktop. But then, for some "unknown reasons," the mobile view started acting up. The main header menu items were appearing much larger than intended, and those stylish underlines on the submenus had vanished. It's frustrating when something that "was working before" suddenly breaks, often hinting at a recent theme update or a conflict.

Geronim0 shared their existing custom CSS, which looked something like this:

.mega-menu__list span.wrap-text {
text-transform: capitalize !important;
font-size: 14px !important;
text-decoration: underline !important;
text-underline-offset: 4px;
}
.menu-drawer__list-item–deep.menu-drawer__list-item–divider
.menu-drawer__menu
span {
text-transform: capitalize !important;
font-size: 14px !important;
text-decoration: underline !important;
text-underline-offset: 4px;
}

They specifically noted that the highlighted selectors (.mega-menu__list span.wrap-text and the multi-line .menu-drawer__list-item–deep.menu-drawer__list-item–divider .menu-drawer__menu span) no longer seemed to be recognized correctly for the mobile view.

Digging Into the Community's Wisdom: Two Approaches

The beauty of the Shopify community is how quickly fellow merchants and experts jump in to help. Two different approaches emerged in this thread, offering valuable insights.

1. Daniel_Jude's CSS Syntax Check

First, Daniel_Jude spotted a crucial detail in Geronim0's second CSS block. It's a common mistake, even for seasoned coders! When you list multiple selectors on separate lines without commas, the browser interprets them as a nested selector (i.e., "an element with class 'span' inside an element with class 'menu-drawer__menu' which is inside an element with both classes 'menu-drawer__list-item--deep' AND 'menu-drawer__list-item--divider'"). This is highly specific and likely wouldn't match the intended elements.

Daniel_Jude correctly advised adding commas to treat them as distinct targets:

.menu-drawer__list-item--deep,
.menu-drawer__list-item--divider,
.menu-drawer__menu span {
font-size: 14px !important;
}

While this is excellent general CSS advice and crucial for targeting multiple elements, Geronim0 later reported that this specific tweak didn't resolve the main mobile header font size issue. This tells us the problem wasn't just about syntax, but about *which* elements were being targeted for the mobile menu.

2. PinFlow's Targeted Mobile CSS for the Horizon Theme

This is where PinFlow, a regular helpful voice in the community, stepped in with the winning solution. PinFlow pointed out that for themes like "Horizon" (which Geronim0 was likely using, though not explicitly stated initially), the mobile menu often requires its own, specific CSS rule. This is a vital lesson: desktop and mobile menus, while seemingly the same, often have different underlying HTML structures or class names that need to be targeted separately, especially within a media query.

PinFlow's magic snippet was a media query, ensuring the styles only apply to screens smaller than 750px (typical mobile widths):

@media screen and (max-width: 749px) {
  .menu-drawer__menu-item--mainlist .menu-drawer__menu-item-text {
    font-size: 14px !important;
  }
}

Geronim0 quickly confirmed that this snippet "fixed the issue on mobile view!" They also mentioned something interesting: after adding PinFlow's custom CSS, they deleted their *existing* code and re-pasted it, and then "everything got sorted," including the missing underlines on submenus. This suggests a bit of a refresh or reapplication of styles was needed, perhaps due to a caching issue or conflicting styles that were resolved by re-ordering or re-applying the custom CSS.

How to Apply This Mobile Menu Fix to Your Shopify Store

If you're facing a similar mobile menu font size issue, especially if you're on a modern Shopify theme like Horizon, here are the steps, as detailed by PinFlow:

  1. Access Your Theme Settings: Go to your Shopify admin, then navigate to Online Store > Themes.
  2. Edit Your Theme: Find your current theme (e.g., Horizon) and click on the "..." (three dots) button, then select Customize. This opens the theme customizer. (PinFlow's image shows "Edit theme", which is the entry point to the customizer). Online Store, Edit theme
  3. Open Theme Settings: In the theme customizer, click the Theme settings gear icon on the left sidebar. Theme settings gear
  4. Find Custom CSS: Scroll down and open the Custom CSS section.
  5. Paste the Code: Click at the very end of any existing CSS you have there, press Enter for a new line, and then paste this code:
    @media screen and (max-width: 749px) {
      .menu-drawer__menu-item--mainlist .menu-drawer__menu-item-text {
        font-size: 14px !important;
      }
    }
    Custom CSS box
  6. Save Changes: Don't forget to click Save! Save

Once saved, open your store on your phone (or use your browser's developer tools to simulate a mobile view). You should see the main menu items now at 14px. Feel free to adjust the font-size value if you want them a bit bigger or smaller. Remember to clear your phone's browser cache if you don't see the changes immediately!

Here's a visual of the before and after, courtesy of PinFlow:

Before: big main menu on mobile

After: 14px main menu on mobile

Why This Happens and What to Remember

This whole discussion highlights a few key things for anyone running a Shopify store:

  • Theme Updates are a Double-Edged Sword: While updates bring new features and security, they can sometimes tweak underlying HTML or CSS class names. This is often the "unknown reason" why custom CSS suddenly stops working. Always keep an eye on your crucial elements after an update.
  • Mobile-First Design Isn't Just a Buzzword: Modern themes try to be responsive, but sometimes specific mobile elements need their own rules, especially if you're layering custom styles. Media queries are your best friend here!
  • Specificity Matters: Daniel_Jude's advice on commas is a great reminder that CSS selectors need to be precise. And PinFlow's solution shows that sometimes you need to find the *exact* selector for a specific element (like .menu-drawer__menu-item--mainlist .menu-drawer__menu-item-text) rather than a more general one.
  • Don't Be Afraid to Re-apply: Geronim0's experience with deleting and re-pasting their code to fix the submenus suggests that sometimes a fresh application of your CSS can resolve minor conflicts or caching issues.

Maintaining a seamless user experience across all devices is crucial for any successful online business. If you're just starting your journey into e-commerce, or looking to migrate your existing store to a platform that empowers you with flexibility and a supportive community, I highly recommend exploring Shopify. Their robust theme architecture and extensive customization options, coupled with a vibrant community ready to help, make it a fantastic choice.

I hope this deep dive into a common mobile menu issue helps you fine-tune your own store. Keep those questions coming in the forums, because every problem solved there helps countless other merchants like you!

Share:

Start with the tools

Explore migration tools

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

Explore migration tools