A Shopify store owner needed to apply different color schemes to the header section across pages in the Prestige theme: scheme-4 for the homepage and scheme-3 for other pages.
Initial Solution:
A contributor (tim_1) provided a JavaScript-based approach using a Custom Liquid section that:
Uses JS to swap CSS classes that control color scheme variables
Targets elements with color-scheme--scheme-3 and changes them to scheme-4 on the homepage
Troubleshooting Process:
Multiple issues emerged during implementation:
White strip appeared on homepage due to Prestige theme adding padding to Custom Liquid sections
Product titles overlapped with header on non-homepage pages
Homepage header lost its transparency
Final Resolution:
The solution required relocating the Custom Liquid section from the “Header Group” to immediately after the top slideshow section. The code remained unchanged, but this positioning prevented the section from breaking the homepage header’s transparency feature.
The issue was successfully resolved after iterative debugging with preview link testing.
Summarized with AI on October 28.
AI used: claude-sonnet-4-5-20250929.
Ultimately, color scheme defines CSS variables. In many modern themes they use classes to assign these variables to particular elements.
Say, when they want to use “Color scheme 4” on some element, they assign a color-scheme–scheme-4 class to the element (or its wrapper):
The simple solution without theme code editing would be to change this class with JS.
For this you need to:
1. Assign the color scheme 3 on the header in "Customize" and then do this:
2.Add a "Custom Liquid" section in "Header" section group and paste this code:
```php
{%- if template.name == "index" -%}
{%- endif -%}
The code finds elements with color scheme 3 assigned inside header and changes them to color scheme 4.
Why not simply edit Liquid code?
Editing theme code will prevent theme from updating automatically.
Using “Custom liquid” or “Custom CSS” settings does not.
Thank you for reply.
When I did what you said, I got a result like in the images. Yes, the color scheme changed on pages other than the homepage. There is a white strip on the homepage until the level of the dropdown menu. (Normally the homepage header is transparent.)
Thanks, it became transparent, but now there is a spacing problem on pages other than the homepage. For example, in the photo the product title is under the header. https://ibb.co/gMprJfNN