Changing header from transparent & white font/logo to white header & black font/logo after scrolling

I am currently using Dawn theme 7.0.1 and I want to make it so my header upon entering the site is transparent with all the text/menu items to be white as well as having my white version of my logo. And then once you scroll down a bit the sticky header turns to white and black text as well as the black version of my logo.

Some examples of it done well are:

How do I go about changing this in the code? Please be as detailed as possible because my coding knowledge is extremely basic. Please let me know if you need any additional information or if you have any questions.

My website link is: https://hakatasociety.myshopify.com/

pwd: shahna

Thank you!

Hello @doisdemonios

I would like to give you the recommendation to support you so kindly follow steps below:

  1. Go to your Online store > Themes > Edit code
  2. Open your theme.liquid file
  3. Paste the below code before

I hope the above is useful to you.
Best regards,
GemPages Support Team

Super helpful! The code you provided made the header initially transparent and fill once I scroll.

2 Things:

  1. The menu item text is still black the entire time. How do I make it so it starts off as white and changes to black once the header turns white? Same goes for having my light version of the logo to start and then changing it to black

  2. There now is a weird black outline surrounding the header when its transparent. How would I go about getting rid of this?

Thanks for your reply.

For the text color and black outline, you can replace the above code with the below code to resolve :


For the logo, you can hire an expert to customize the header for you.

I hope the above is useful to you.
Best regards,
GemPages Support Team

Again super helpful! If you could be so kind, I do believe we can make this work without hiring an expert. Given that these are the URL links to the 2 different logos (show white logo when header transparent, show black logo when header fills white), are there any edits to do to the code you provided to reflect the changing of the 2 logos?

Thank you so much for the help.

Light Logo URL: https://cdn.shopify.com/s/files/1/0702/7294/2394/files/IG_Logo_6.png?v=1679885653

Dark Logo URL: https://cdn.shopify.com/s/files/1/0702/7294/2394/files/IG_Logo_5.png?v=1679869367