Transparent sticky Header that turns white when you scroll and only applies to the home page

I can’t seem to find any video on how to actually do this. I don’t have " theme.css " in my code files either so if someone can help me out it would mean a lot. Thanks.

Hi Nick,

You need to add code to the header template to make that work. You can add the if-else liquid condition there with a CSS code for the scroll and transparency. It will work that way.

Where do I do that?

Hi @NickBananto

please provide your store Url so I can check to help

Regards,

James

proepickleball.com

Hi @NickBananto ,

If you have coding knowledge, You can go to header.liquid file and edit the code there as I explained in my previous reply.

Hi @NickBananto

Please add this custom CSS to your theme

{% if template == 'index' %}

{% endif %}

Open the file layout/theme.liquid then add the code to before closing tag

If there is any issue, please revert the code and let me know.

1 Like

Hello @NickBananto

You can follow these steps:

  1. Go to Online Store->Theme->Edit code

  1. Open your theme.liquid file, paste the below code before

{%  if template contains 'index' %}
      
    {%  endif %}

I hope the above is useful to you.

Kind & Best regards,
GemPages Support Team

1 Like

I don’t know if I did it right, I went under and deleted until {% endif %} and pasted the code but it still doesn’t work.

Please don’t remove anything, just add the code to before tag like this: https://take.ms/KRhpE

Hi @NickBananto ,

Can you record a video of how you are doing that? That would help me to guide you better.

Okay so I added it and it works, but the lettering is black, how do I make it white?

Please replace old CSS by the CSS below

{% if template == 'index' %}

{% endif %}
1 Like

So that only made the menu white but didn’t make the logo white or the search and cart icon. Im sorry haha

Do you know how to make the search and cart icon white as well as the logo ? Thanks so much for the help.

Still any update on how to change the icons to white and making them black when the header comes down?