Taming the Dawn Theme Mobile Menu: Fixing Off-Center Icons and Mysterious Blue Bars

Alright, fellow store owners, let's talk about those little visual quirks that can sometimes pop up and drive us absolutely bananas. You know the ones – seemingly minor, but they just gnaw at you, especially when they affect your mobile experience. Recently, we saw a great example of this in the Shopify community, where a store owner, Kiwart, was grappling with a peculiar mobile menu issue on their Dawn theme.

It’s a common scenario: you’ve got your beautiful store, everything looks great on desktop, but then you check it on your phone, and BAM! Something’s just… off. For Kiwart, it was an off-center burger icon (the three lines that open your mobile menu) and its corresponding 'close' icon, along with a mysterious blue bar appearing on the mobile menu. It’s exactly these kinds of small, yet impactful, visual glitches that can make a difference in how professional your store feels to a mobile shopper.

The Mobile Menu Mystery: Off-Center Icons & The Blue Bar

Kiwart’s initial post painted a clear picture of the problem. After a previous fix (presumably for a different issue), they noticed a new 'bug' – a blue bar on the mobile menu and the menu icons themselves not being centered. Here's a peek at what they were seeing:

The core issue here, as many experienced developers in the community quickly surmised, often boils down to CSS conflicts. Specifically, when the mobile menu is open, the 'hamburger' icon should disappear and the 'close' icon should appear, and vice-versa. If both are somehow rendered, even if one is set to visibility: hidden or opacity: 0, it can still occupy space, cause misalignment, or reveal underlying elements like that pesky blue bar.

The Community Weighs In: Multiple Paths to a Solution

It’s always great to see the community rally! Several experts quickly jumped in, asking for Kiwart's store URL and password (which was Privateviewscreen.com password 16) to diagnose the problem. This is a crucial first step in any debugging process – seeing the live issue.

The solutions proposed generally aimed at the same goal: ensuring that only one of the two menu icons (hamburger or close) is actively displayed at any given moment. This prevents overlap and ensures proper alignment. Here’s a look at the different approaches suggested:

Approach 1: Direct CSS Modification or Custom CSS Block

tim_1 and mastroke both suggested a similar CSS snippet. Their idea was to explicitly hide both the 'close' icon when the menu is not open and the 'hamburger' icon when it is open. This ensures only the relevant icon is visible.

You could either find and modify an existing CSS block in your assets/base.css file (though I generally recommend against directly editing core theme files unless you're very comfortable and have backups) or, more safely, add this to your theme's Custom CSS section in the Theme Editor:

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

Approach 2: Media-Query Specific CSS

Huptech-Web offered a solution that was specifically scoped for mobile screens using a CSS media query. This is a good practice as it ensures your styles only apply when necessary, preventing unintended side effects on larger screens.

This code would also typically be added to your base.css or a dedicated custom CSS file:

@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 even shared helpful screenshots to guide the process:

The Confirmed Fix: Moeed's Precise CSS Injection

While all these solutions tackle the core problem, it was Moeed's specific approach that Kiwart confirmed as working perfectly! This solution is particularly robust because it leverages the aria-expanded attribute, which is a standard accessibility feature that indicates whether an expandable element is currently expanded or collapsed. By targeting this attribute, we ensure the CSS only applies based on the true state of the menu.

Here’s how to implement Moeed’s fix:

  1. Go to your Shopify Admin.
  2. Navigate to Online Store > Themes.
  3. Find your current theme (Dawn) and click Actions > Edit Code.
  4. In the left sidebar, find the theme.liquid file under the 'Layout' directory and open it.
  5. Scroll all the way to the bottom of the file. You're looking for the closing tag.
  6. Just above the tag, paste the following code snippet:

The !important flag here is key. It ensures that these styles take precedence over any other conflicting CSS rules that might be causing the icons to overlap or misbehave. Once you save this, you should see the mobile menu icons behave as expected – only one visible at a time, perfectly centered, and that mysterious blue bar should be gone!

Here are the 'before' and 'after' visuals Moeed shared, showing the successful outcome:


Why These Bugs Happen & Your Takeaways

You might be wondering why these little glitches occur in the first place, especially with a robust theme like Dawn. Often, it's a consequence of multiple factors: a recent theme update that slightly altered CSS, custom code you or an app added that conflicted with existing styles, or even just subtle browser rendering differences. The Dawn theme is constantly evolving, and sometimes these small inconsistencies can creep in.

The key takeaway here is twofold: first, never underestimate the power of the Shopify community. When you hit a wall, chances are someone else has faced a similar challenge and found a solution. Second, a little targeted CSS can go a long way. Understanding how to inspect elements and apply specific rules, especially using tools like display: none and !important when necessary, empowers you to fine-tune your store's appearance without needing a full redesign.

Always remember to back up your theme before making any code changes, even small ones like this. It's a quick habit that can save you a lot of headaches down the line. And if you're ever unsure, don't hesitate to reach out to a developer or, of course, the ever-helpful Shopify community!

Share:

Use cases

Explore use cases

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

Explore use cases