Sticky Custom Liquid (announcement bar) Not working on mobile

Solved

Sticky Custom Liquid (announcement bar) Not working on mobile

JosueOtavalo
Excursionist
17 0 4

Website name: Diffu.ca 

 

Hello Again, I wanted to fix this urgent issue, so I posted again but with more information. I am using Shrine Pro v1.0.4 and wanted to add a sticky announcement bar (this is actually a custom liquid I made, so it is not actually a announcement bar, but a custom liquid coded as one)  above the header, which is also sticky. However, when I used the default announcement bar, there was an unpleasant gap between it and the header. To fix this, I used a custom Liquid section as an announcement bar. The issue popped up that the custom liquid would overlap with the cart drawer, so I adjusted the z-index and found that setting it to 7 works well without interfering with the cart drawer on mobile. However, on mobile, when I open the menu drawer, the custom liquid with  overlaps it. I’ve tried different solutions but haven’t found a way to fix this. Additionally, when I scroll down and open the menu drawer on mobile, the drawer appears dark for some reason. 

Screenshot 2025-04-01 171822.pngScreenshot 2025-04-01 171629.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Here is how I got my announcement bar/Custom Liquid made. I copied this off a shopify discussion board and pasted the code at the bottom of my theme.liquid.

Screenshot 2025-04-01 181244.png

My header would overlap with the custom liquid/announcement bar so i moved my header down with padding top.

Screenshot 2025-04-01 181310.png

So technically the custom liquid is just on top of the header, and once the header has a higher z-index then the custom liquid, the custom liquid disappears under it.

 

If any of you need access to my code please feel free to ask, my header has some code has start as transparent, then white when scrolled down with the header text and icons turning black. you can check my website to see. 

any help would be appreciated!

Accepted Solution (1)

EBOOST
Shopify Partner
1395 351 428

This is an accepted solution.

Hi @JosueOtavalo ,

Maybe I suggest I add code below to Assets/base.css:

.scrolled-past-header .header-wrapper #menu-drawer * {
	color: rgba(var(--color-foreground),1)!important;
}

@media(max-width: 749px){
	
	body.overflow-hidden-tablet .section-header.shopify-section-group-header-group {
		z-index: 10;
	} 
}
- Hope can help. If you find my reply helpful, please hit Like and Mark as Solution
- Need a Shopify developer? Contact email: eboost10@gmail.com
- Visit our site: https://www.eboosttech.net to view and download shopify themes and magento2 extensions free. Github.com/eboost10
- ❤❤DONATE ❤❤Coffee tips

View solution in original post

Replies 6 (6)

Dan-From-Ryviu
Shopify Partner
11612 2276 2456

Hi @JosueOtavalo 

You can add this code to solve the issue with your menu

.section-header.shopify-section-group-header-group { z-index: 9999 !important; }

Screenshot 2025-04-04 at 09.44.58.png

 

 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

JosueOtavalo
Excursionist
17 0 4

Yes but now the announcement bar disappears when you scroll down. My header is transparent but becomes filled when scrolled down. And since initially both the announcement bar and header were in the same position when fixed. I moved the header doing using padding. 

Dan-From-Ryviu
Shopify Partner
11612 2276 2456

Please update the code 

html .section-header.shopify-section-group-header-group { 
    z-index: 9999 !important; 
    top: 47px; 
}

And remove this code that you added

.header {
    padding-top: 55px !important;
    z-index: 4 !important;
    margin-top: 0px !important;
}

 

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

JosueOtavalo
Excursionist
17 0 4

Thanks for the reply, however for some reason the header moves depending if its on mobile or on desktop, this causes a gap to be seen on mobile. 

Screenshot 2025-04-05 132933.pngScreenshot 2025-04-05 132947.png

EBOOST
Shopify Partner
1395 351 428

This is an accepted solution.

Hi @JosueOtavalo ,

Maybe I suggest I add code below to Assets/base.css:

.scrolled-past-header .header-wrapper #menu-drawer * {
	color: rgba(var(--color-foreground),1)!important;
}

@media(max-width: 749px){
	
	body.overflow-hidden-tablet .section-header.shopify-section-group-header-group {
		z-index: 10;
	} 
}
- Hope can help. If you find my reply helpful, please hit Like and Mark as Solution
- Need a Shopify developer? Contact email: eboost10@gmail.com
- Visit our site: https://www.eboosttech.net to view and download shopify themes and magento2 extensions free. Github.com/eboost10
- ❤❤DONATE ❤❤Coffee tips
JosueOtavalo
Excursionist
17 0 4

Wow thanks this solved it!