Shopify Mega Menu Too Wide? A Community-Proven Fix for Feather & Dawn Themes

Hey there, fellow store owners! It's your friendly Shopify expert here, fresh off a dive into the community forums. I came across a super common question that many of you might have faced, especially if you're rocking a modern Shopify theme like Feather or Dawn. It's all about taming those sprawling mega menu dropdowns!

Our community member, Sierra_Covell1, kicked off a discussion because her sub-menu dropdowns in the Feather theme were taking up the entire width of the page, with the sub-menu items annoyingly shifted far to the left. What she really wanted, and what many of us prefer, is a nice, compact dropdown that's just wide enough to fit its content and sits neatly right under the parent menu item. Sound familiar?

Understanding the Mega Menu Challenge

First off, it's important to know that this isn't a bug; it's often a design choice. As one of our experts, ai-theme-code-editor, pointed out, many popular themes, including Feather, are built with a full-width mega menu by default. This design aims to provide a lot of space for categories, images, and promotions, but it's not always ideal for simpler menus.

Before diving into code, it's always a good idea to check your theme's built-in options. Head over to Online Store > Themes > Customize > Header. Some themes might offer layout options like 'Mega Menu', 'Dropdown', or 'Compact' that could solve your problem without any custom code. If you've purchased a third-party theme, their documentation or support team might also have a quick solution or a specific setting.

However, if those settings aren't cutting it, then it's time to roll up our sleeves and get a little technical. The good news is that the community came through with a precise, actionable solution!

The Community's CSS Fix for Compact Sub-Menus

Ploqo, another helpful community member, confirmed that Sierra's Feather theme is indeed built on the Dawn theme, which means this solution is super relevant for anyone using Dawn or its variants. They provided a fantastic CSS snippet that transforms that wide, sprawling mega menu into a sleek, content-aware dropdown. Here’s a visual of the transformation:

Before and After: A Visual Guide

Before - the dropdown opens at full page width

Before: The dropdown opens at full page width, pushing content far left.

After - compact dropdown, directly under the menu item

After: A compact dropdown, perfectly aligned under its parent menu item. Much cleaner!

Step-by-Step Instructions to Implement the CSS Fix

Ready to make this change on your own store? Here’s how you do it:

  1. Open Your Theme Code:
    • From your Shopify admin, go to Online Store > Themes.
    • Find your current theme (it's always a good idea to duplicate your theme before making any code changes, just in case!).
    • Click the ... (Actions) button, then select Edit code.

      Online Store > Themes > ... > Edit code

  2. Paste the Code:
    • In the theme code editor, look for the Assets folder and open the file named base.css.
    • Scroll all the way to the very bottom of this file.
    • Paste the following CSS code exactly as it appears below, then click Save.
      /* Compact submenu dropdown - fits its content, sits under the parent */
      .header-wrapper .header__inline-menu .mega-menu {
        position: relative;
      }
      .header-wrapper .header__inline-menu .mega-menu__content {
        left: 0;
        right: auto;
        width: max-content;
        min-width: 16rem;
        max-width: 90vw;
        padding: 1.5rem 0;
        border: 0.1rem solid rgba(var(--color-foreground), 0.1);
        border-top: 0;
        box-shadow: 0 1rem 2rem rgba(var(--color-foreground), 0.12);
      }
      .header-wrapper .header__inline-menu .mega-menu__list {
        display: block;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0 2rem;
        gap: 0;
      }
      .header-wrapper .header__inline-menu .mega-menu__list > li {
        width: auto;
        padding-right: 0;
      }
      .header-wrapper .header__inline-menu .mega-menu__list > li + li {
        margin-top: 1rem;
      }
      .header-wrapper .header__inline-menu .mega-menu__link {
        white-space: nowrap;
      }
      

      Paste the code at the bottom of base.css, then Save

  3. Done:
    • Reload your store, and open the menu. You should now see a beautiful, compact dropdown sitting right where it belongs!

Important Considerations & Adjustments

While this CSS provides a solid fix, it's worth noting a couple of things, as highlighted by VikashJ in the discussion:

  • Long Menu Items: The code includes white-space: nowrap; on .mega-menu__link. This keeps your sub-menu items all on one line, which usually looks great in a compact menu. However, if you ever add a sub-menu item with a genuinely long name (think 40+ characters!), it might wrap awkwardly or get clipped when it hits the max-width: 90vw; limit on smaller desktop screens. If that happens, simply change white-space: nowrap; to white-space: normal; for that specific link or globally if you prefer wrapping.
  • Adjusting Minimum Width: Ploqo also mentioned that the min-width: 16rem; property in the CSS sets the smallest width for your dropdown panel. If you find your dropdown too narrow or too wide, you can adjust this value. Increasing it will make the panel wider, while decreasing it will make it tighter. Remember, the panel will still grow to accommodate your longest menu item!

Isn't it great how the Shopify community comes together to solve these little design quirks? This kind of shared knowledge is invaluable for store owners who want to fine-tune their online presence without needing to hire a developer for every tweak. Whether you're just starting your Shopify store or you've been running one for years, these little CSS adjustments can make a big difference in user experience. So go ahead, give it a try, and make your navigation as clean and user-friendly as possible!

Share:

Start with the tools

Explore migration tools

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

Explore migration tools