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:
- Go to your Shopify Admin.
- Navigate to Online Store > Themes.
- Find your current theme (Dawn) and click Actions > Edit Code.
- In the left sidebar, find the
theme.liquidfile under the 'Layout' directory and open it. - Scroll all the way to the bottom of the file. You're looking for the closing




