What's your biggest current challenge? Have your say in Community Polls along the right column.

Search results do not adhere to theme colour settings

Solved

Search results do not adhere to theme colour settings

EGG24
Tourist
3 1 2

Hi Shopify community, 

I'm in the process of setting up my first ecommerce store. 

I have been trying to troubleshoot this issue with no success. I am using the Dawn Theme and the search results page does not adhere to my theme colour settings. 

I have manually changed the background colour to match the theme in the 'custom CSS' section but can't figure out how to change all of the text to 'white'.

Also, I would prefer the search bar to also match the background colour, but as a priority I'd like to solve the unreadable text issue first.


Any help would be greatly appreciated. 

Cheers

 

EGG24_0-1706392356052.png

 

Accepted Solution (1)

EGG24
Tourist
3 1 2

This is an accepted solution.

If anyone else runs into this issue, I've found a way to fix it. However, it's not very efficient or elegant. 

I inserted the following code into the 'custom css' box for the 'search results' template

{
  background: #292929 !important;
}
.card__heading {
  color: white;
}
.card__information {
  color: white;
}
.price {
  color: white;
}
h1.h2 {
  color: white;
}
.facets__summary {
  background: #292929;
  color: white;
}
.facet-filters__sort {
  background: #292929;
  color: white;
}
.facet-filters__field {
  background: #292929;
  color: white;
}
.facet-filters__label {
  background: #292929;
  color: white;
}
.product-count__text {
  background: #292929;
  color: white;
}
.facets__heading {
  background: #292929;
  color: white;
}
.mobile-facets__open {
  background: #292929;
  color: white;
}


Cheers


EGG24_0-1706482986166.png

 

View solution in original post

Replies 4 (4)

EGG24
Tourist
3 1 2

This is an accepted solution.

If anyone else runs into this issue, I've found a way to fix it. However, it's not very efficient or elegant. 

I inserted the following code into the 'custom css' box for the 'search results' template

{
  background: #292929 !important;
}
.card__heading {
  color: white;
}
.card__information {
  color: white;
}
.price {
  color: white;
}
h1.h2 {
  color: white;
}
.facets__summary {
  background: #292929;
  color: white;
}
.facet-filters__sort {
  background: #292929;
  color: white;
}
.facet-filters__field {
  background: #292929;
  color: white;
}
.facet-filters__label {
  background: #292929;
  color: white;
}
.product-count__text {
  background: #292929;
  color: white;
}
.facets__heading {
  background: #292929;
  color: white;
}
.mobile-facets__open {
  background: #292929;
  color: white;
}


Cheers


EGG24_0-1706482986166.png

 

modernmagic
Shopify Partner
9 0 2

I figured out that the search page settings and therefore the liquid code does not include a color-scheme.

 

So instead of adding all your custom css, I opted to hard code the color-scheme into the section s/main-search.liquid file.  In my case, I wanted color-scheme-1 so I added it to this line:

 

<div class="template-search{% unless search.performed and search.results_count > 0 %} template-search--empty{% endunless %} section-{{ section.id }}-padding color-scheme-1">

 

EGG24
Tourist
3 1 2

Nice one! 

 

Thanks for sharing - that's a much more more straightforward solution than mine!  

DP_2023
Excursionist
39 0 6

Fantastic - this is really helpful! Thanks 😁