Different header text color in different pages

Solved

Different header text color in different pages

Sougias
Tourist
12 0 1

Hello Shopify Community!

I am glad for being a member of yours.

With some code experience, not much, I tried working on having different header text colors in different pages, without getting any results. I have done a lot of research but nothing really comes up or works. I am good at listening at tutorials but the problem doesn't seem to fix. I also found the same question here, in the community, but the theme.css part of code isn't there because I use the DAWN theme.

 

I currently use a transparent header code that I found, which I want to keep, and works fine, but the text color is black and can't be seen very clearly. If I change the color scheme of the header, then all the pages have that color, something I don't want.

 

Can somebody help? It would be really nice.

Thank you

(my store)

Accepted Solution (1)

GTLOfficial
Shopify Partner
549 116 108

This is an accepted solution.

HEllo @Sougias 

Go to Admin -> Online store -> Theme > Edit code--->Find the file theme.liquid
Add this code before </body>

{%- if template.name == 'home' -%}
<style>
.header__menu-item {
color: crimson !important;
}
.header__icon {
color: crimson !important;
}
.header__active-menu-item {
color: crimson !important;
}
</style>
{%- endif -%}

result
14.png

If this was helpful, hit the like button and accept the solution.
Thanks

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: [email protected] - Skype: ritesh_27dh

View solution in original post

Replies 12 (12)

Tech_Coding
Shopify Partner
309 79 70

Hello @Sougias 

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid

{% if template == 'index' %}
   <style>
      header ul.list-menu.list-menu--inline li a, span {
         color: #fff !important;
      }
   </style>

{% endif %}

Tech_Coding_0-1726657465168.png

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.
Shopify UI Developer
Your Coffee Tips adds a little sweetness to my day.
Sougias
Tourist
12 0 1

That worked, but the dropdown menu text is also white with a white background. What can I do?

Tech_Coding
Shopify Partner
309 79 70

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid

{% if template == 'index' %}
  <style>
     a#HeaderMenu-catalog-men, a#HeaderMenu-catalog-women {
        color: #000 !important;
     }

     .header__menu-item .icon-caret{

         color: #fff !important;

    }
  </style>

{% endif %}

Tech_Coding_0-1726659237814.png

my reply helpful? Click Like to let me know!
your question answered? Mark My Both solutions as an Accepted Solution.

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.
Shopify UI Developer
Your Coffee Tips adds a little sweetness to my day.
Sougias
Tourist
12 0 1

That works too, but I noticed that prices don't show up, OR they are white and blend in with the background.

Tech_Coding
Shopify Partner
309 79 70

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
<style>
  span.price-item.price-item--regular {
     color: #000 !important;
  }
</style>

/*also add this code to make dropdown icon white*/

{% if template == 'index' %}
<style>
   details[open] > .header__menu-item .icon-caret {
      color: #fff !important;
   }
   .header__menu-item .icon-caret {
        color: #fff !important;
    }
</style>
{% endif %}

Tech_Coding_0-1726660604281.png

my reply helpful? Click Like to let me know!
your question answered? Mark My All Solutions as an Accepted Solution.

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.
Shopify UI Developer
Your Coffee Tips adds a little sweetness to my day.
Sougias
Tourist
12 0 1

support2.png

Tech_Coding
Shopify Partner
309 79 70

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
<style>
  span.price-item.price-item--regular {
     color: #000 !important;
  }
</style>

/*also add this code to make dropdown icon white*/

{% if template == 'index' %}
<style>
   details[open] > .header__menu-item .icon-caret {
      color: #fff !important;
   }
   .header__menu-item .icon-caret {
        color: #fff !important;
    }
</style>
{% endif %}

Tech_Coding_0-1726661205572.png

my reply helpful? Click Like to let me know!

your question answered? Mark My All Solutions as an Accepted Solution.

my reply helpful? Click Like to let me know!
your question answered? Mark it as an Accepted Solution.
Shopify UI Developer
Your Coffee Tips adds a little sweetness to my day.
Sougias
Tourist
12 0 1

All nice again, it worked, but the announcement bar text is also white, as you can see in the photo. Can we do something about that?

GTLOfficial
Shopify Partner
549 116 108

This is an accepted solution.

HEllo @Sougias 

Go to Admin -> Online store -> Theme > Edit code--->Find the file theme.liquid
Add this code before </body>

{%- if template.name == 'home' -%}
<style>
.header__menu-item {
color: crimson !important;
}
.header__icon {
color: crimson !important;
}
.header__active-menu-item {
color: crimson !important;
}
</style>
{%- endif -%}

result
14.png

If this was helpful, hit the like button and accept the solution.
Thanks

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: [email protected] - Skype: ritesh_27dh
Sougias
Tourist
12 0 1

Edit: It worked! I made a small change to the home page to index and works fine, except for the white letters in the dropdown menu, which I may already have a solution for

 

Sougias
Tourist
12 0 1

Everything works fine! I did a bit of coding myself too and problem solved. Thank you very much!

(This is the code I used at the end to make everything work as planned)

 

    {% if template == 'index' %}
  <style>
.header__menu-item {
color: white !important;
}
.header__icon {
color: white !important;
}
.header__active-menu-item {
color: white !important;
}
     a#HeaderMenu-catalog-men, a#HeaderMenu-catalog-women {
        color: #000 !important;
     }
     .header__menu-item .icon-caret
         color: #fff !important;
    }
  </style>

{% endif %}
GTLOfficial
Shopify Partner
549 116 108

Happy to help you.

- Buy me a Pizza
- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on the store Hire me. GTL web solutions
- Want Complete Storefront: Send an email ⇨- Email: [email protected] - Skype: ritesh_27dh