A user seeks help making the Dawn theme announcement bar sticky on mobile devices. Their CSS code works on desktop but fails on mobile despite using !important declarations and media queries.
Initial Solution:
Add JavaScript code to theme.liquid file above the </body> tag
This successfully makes the announcement bar sticky on mobile
Follow-up Issue:
The sticky announcement bar now overlaps the menu/header. An additional CSS code snippet is provided to resolve the overlap.
Advanced Request:
The user wants the announcement bar to remain sticky at all times, but the header/menu should only be sticky when scrolling up (using Dawn’s “On scroll up” setting). Updated JavaScript code is provided to achieve this behavior.
Alternative Approach:
Another user suggests adding CSS directly to base.css file with the same media query code, referencing a YouTube tutorial.
The thread remains active with another user seeking similar help for their mobile announcement bar.
Summarized with AI on October 25.
AI used: claude-sonnet-4-5-20250929.
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Perfect! One last question! I’d like my announcement bar to remain sticky at all times but have my menu/header only sticky when scrolling up. I’ve updated this setting on the Header setting for Sticky “On scroll up”.
The setting looks works for a second but then the entire header/menu appears again, assuming it because of a previous code?