Mobile Menu Mayhem? Fixing Dawn Theme's Pesky Hamburger & Close Icon Glitches

Hey there, fellow store owners! It's your Shopify migration expert dropping in with some real-world insights from the community trenches. You know, sometimes it's the little things that can drive us absolutely batty, especially when it comes to keeping our mobile sites looking pristine. Recently, I stumbled upon a thread that perfectly illustrates this – a classic case of a seemingly small visual bug causing a headache for a store owner named Kiwart.

Kiwart reached out to the community with a head-scratcher: a "blue bar" appearing on their mobile menu, right near the hamburger icon, and what looked like some misalignment with the mobile menu's open/close functionality. It wasn't just a visual nuisance; it pointed to a deeper CSS hiccup. Take a look at the initial image Kiwart shared:

Screenshot 2026-04-15 at 17.35.19

The problem, as it turned out, was a common one in the Dawn theme, often revolving around how the hamburger (menu open) and 'X' (menu close) icons are handled. Sometimes, due to conflicting CSS or custom code, both icons can briefly appear, or one might cause layout shifts when the other is supposed to be active. The "blue bar" Kiwart mentioned was likely an underlying element or part of an icon that wasn't properly hidden.

Understanding the Mobile Menu Icon Overlap

Before diving into solutions, let's quickly understand what's happening. Modern themes like Dawn often use a clever trick for the mobile menu: they have both the "hamburger" icon and the "close" (X) icon present in the HTML at all times. CSS then dictates which one is visible based on whether the menu is open or closed. When this CSS gets a bit tangled – maybe from a custom app, a theme update, or some manual tweaking – you can end up with both icons showing, or one pushing the other out of place, causing those frustrating alignment issues.

The community quickly jumped in to help Kiwart. Shoutout to Moeed, tim_1, and Huptech-Web for their swift and helpful responses!

The Go-To Fix: Targeting Icon Visibility with CSS

Several excellent solutions were proposed, all aiming to ensure that only the correct icon is displayed at any given time. Moeed's approach, which Kiwart confirmed worked perfectly, involves adding a small snippet of CSS directly into your theme.liquid file. This is a powerful way to ensure your rules are applied, especially with the use of !important to override any conflicting styles.

Step-by-Step: Implementing Moeed's Solution

Here's how you can implement this fix for your Dawn theme:

  1. Go to your Shopify Admin: From your dashboard, navigate to Online Store.
  2. Edit your Theme Code: Click on Themes, then find your current Dawn theme and click Actions > Edit code.
  3. Locate theme.liquid: In the file editor, search for and open the theme.liquid file.
  4. Add the CSS Snippet: Scroll down to the very bottom of the theme.liquid file. Just above the closing tag, paste the following code:

This code specifically targets the close icon (icon-close) when the menu is not expanded (aria-expanded="false") and hides it. Conversely, it hides the hamburger icon (icon-hamburger) when the menu is expanded (aria-expanded="true"). The !important flag makes sure these rules take precedence.

Here's what the result should look like, showing the hamburger icon when the menu is closed and the 'X' (close) icon when it's open, with no overlap:


Alternative CSS Approaches from the Community

While Moeed's solution is robust, it's always good to know there are other ways to skin a cat (or fix a CSS bug!). Tim_1 and mastroke suggested a similar approach, focusing on the base.css file or the custom CSS section in your theme settings. This is often a cleaner place for custom styles.

Option 1: Modifying base.css or Theme Custom CSS

You can add this rule to your base.css file (typically at the bottom) or, even better, in your Theme Settings' "Custom CSS" section:

details:not([open]) > .header__icon--menu .icon-close,
details[open] > .header__icon--menu .icon-hamburger {
  display: none;
}

This targets the same elements but relies on the details HTML element's open attribute to determine visibility. It's a slightly different selector but achieves a similar goal.

Option 2: Media Query Specific Fix (Huptech-Web's Method)

Huptech-Web provided a solution specifically wrapped in a media query, ensuring these styles only apply to mobile screens (up to 989px wide). This is a smart way to ensure your desktop layout isn't inadvertently affected.

  1. Go to your Shopify Admin: Online Store > Themes > Actions > Edit code.
  2. Open base.css (or your custom CSS file): Paste the following code into the file, ideally at the bottom.
@media screen and (max-width: 989px){
.header details#Details-menu-drawer-container:not(.menu-opening) .icon-close {
    display: none;
}

.header .menu-opening .icon-hamburger {
    display: none;
}
}

Huptech-Web also shared some helpful screenshots for navigating the code editor:

Which Solution is Best for You?

All these solutions tackle the same core problem: ensuring only one menu icon is visible at a time. Moeed's solution, using !important and placed in theme.liquid, is often the most direct way to override any existing conflicting styles. The base.css or Custom CSS options are generally preferred for cleaner code organization, as they keep your styles separate from your core theme files. Huptech-Web's media query approach is excellent for ensuring the fix is mobile-specific. The best choice often depends on your comfort level with code and how many other modifications you've made to your theme.

Always remember to test any changes thoroughly on different devices and browsers after implementing custom code. It's also a good practice to duplicate your theme before making any significant code edits, just in case you need to revert. The Shopify community is a fantastic resource for these kinds of specific issues, and it's awesome to see how quickly people like Moeed, tim_1, and Huptech-Web jump in to help. Keep those mobile experiences smooth, and your customers (and conversions!) will thank you for it!

Share:

Start with the tools

Explore migration tools

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

Explore migration tools