Shopify Nordic Theme: How to Fix Header and Announcement Bar Overlap on Mobile
Hey there, fellow store owners! It's your Shopify migration expert at Shopping Cart Mover, diving into a really common head-scratcher that recently popped up in the Shopify Community forums. We've all been there: you've got your beautiful store, your catchy announcement bar ready to go, and then you check it on your phone… and disaster strikes! Your header is practically eating your announcement bar, making everything look cluttered and unprofessional. Sound familiar?
This exact scenario was highlighted by siva_fds in a recent thread about the popular Nordic theme. They were seeing their header and announcement bar “collapse into each other” on mobile, and trust me, it’s a pain many of you can relate to. Thankfully, the community stepped up with some fantastic solutions, and I’m here to break them down for you, ensuring your mobile shoppers have a seamless experience.
Why Your Header & Announcement Bar Might Be Colliding on Mobile
Before diving into fixes, let's understand the root cause. As rajimulislamjoy pointed out, this is often a spacing or z-index issue, especially on mobile. But what does that really mean?
Titan from Shopplaza gave a brilliant explanation that hits the nail on the head: many themes, including Nordic, might position the header with a hardcoded CSS value like position: absolute; top: 40px;. This value assumes your announcement bar will always be exactly around 40 pixels tall. However, this assumption often breaks down on mobile devices.
Here’s why it’s particularly problematic for mobile:
- Text Wrapping: Announcement bar text that fits neatly on one line on a wider desktop screen very often wraps to two or more lines on narrow mobile screens. This instantly makes the announcement bar taller than its assumed 40px.
- Fixed vs. Dynamic: The header’s
topoffset remains locked at that hardcoded 40px regardless of the announcement bar's actual height. So, once the announcement bar grows beyond that (due to text wrapping, a longer message, or even a font size change), the header starts sitting underneath where the announcement bar’s real bottom edge is. This creates the dreaded "collapse into each other" look. - Z-Index: Sometimes, it can also be a
z-indexissue, where elements are not stacked correctly. The header might have a higherz-index, causing it to appear on top of other elements even if its positioning is off.
Understanding this fundamental flaw is key to implementing a robust solution. Now, let’s look at how the community tackled this.
Community-Approved Solutions for a Clean Mobile Layout
The Shopify community provided two excellent CSS-based solutions. Remember, before making any code changes, it’s always a best practice to duplicate your theme first. This creates a backup, allowing you to revert easily if anything goes wrong.
Solution 1: Adjusting Announcement Bar Height (Ploqo's Method)
This approach focuses on ensuring the announcement bar itself has enough space to accommodate its content on mobile, effectively pushing the header down naturally.
Steps:
- From your Shopify Admin, go to Online Store > Themes.
- Find your Nordic theme, click Actions > Edit code. (Alternatively, click Customize, then the Theme settings icon at the top of the left panel, and choose Custom CSS).
- In the Custom CSS section (or a relevant CSS file like
base.cssortheme.css), paste the following code at the very end:
@media screen and (max-width: 749px) {
html {
--announcement-height: 70px !important;
}
.announcement-bar {
min-height: var(--announcement-height);
}
}
This code block specifically targets screens up to 749px wide (common for mobile devices). It defines a CSS variable --announcement-height and then applies it as a min-height to the .announcement-bar class. The !important flag ensures this rule overrides any conflicting styles.
Pro Tip: If your header still covers part of the bar, increase the 70px value to 90px or more until it looks right. This value depends on your specific announcement bar content and font sizes.
Solution 2: Directly Offset the Sticky Header (ai-code-fixer's Method)
This method directly adjusts the position of the sticky header on mobile, pushing it down by a fixed amount to clear the announcement bar.
Steps:
- From your Shopify Admin, go to Online Store > Themes.
- Find your Nordic theme, click Actions > Edit code.
- Open the
base.cssfile (ortheme.css, depending on your theme's structure). - Paste the following code at the end of the file:
@media only screen and (max-width: 767px) {
.shopify-section-header-sticky.header-overlay.always-fixed {
top: 70px !important;
}
}
This CSS targets the specific classes often used for sticky headers in Shopify themes and sets their top position to 70px on screens up to 767px. Again, the !important flag is used to ensure the style is applied. You might need to adjust the 70px value based on your announcement bar's actual height.
Both solutions achieve a similar goal, but by slightly different mechanisms. Ploqo's solution focuses on giving the announcement bar more room, while ai-code-fixer's solution focuses on pushing the header down.
Beyond the Fix: Best Practices for Shopify Theme Customization
- Always Test: After implementing any code changes, thoroughly test your store on various mobile devices and screen sizes to ensure the fix works universally and doesn't introduce new issues.
- Use the Custom CSS Section: Whenever possible, use the theme's built-in "Custom CSS" section (as shown in Ploqo's steps) rather than directly editing core theme files like
base.css. This makes updates easier and reduces the risk of breaking your theme during future Shopify updates. - Understand Your Theme: While these fixes are common, every theme is slightly different. Familiarize yourself with your theme's structure and CSS classes for more targeted customizations.
- Consider a Robust Migration: If you're frequently encountering these kinds of layout issues, it might be a sign that your current theme isn't fully optimized or that your store could benefit from a fresh start. For merchants looking to start their e-commerce journey or migrate an existing store, Shopify offers a robust and user-friendly platform that minimizes these types of headaches with well-supported themes.
- When in Doubt, Ask an Expert: If you're not comfortable with code or the issue persists, don't hesitate to reach out to a Shopify expert or a development agency. They can provide tailored solutions and ensure your store looks perfect on every device.
Conclusion
A clean, professional mobile experience is non-negotiable in today's e-commerce landscape. By understanding the common pitfalls of header and announcement bar overlap and applying these community-tested CSS fixes, you can ensure your Shopify Nordic theme—or any theme facing similar issues—looks flawless on every device. Remember, a little CSS can go a long way in enhancing your customers' browsing experience and ultimately boosting your sales!