Hi!
I have customized the Dawn theme. I want to refer to the Background Color 2 in my custom.css file, and have it change accordingly whenever the user changes it from the Theme Editor. Any tips on how to do this?
I have tried the following, but it didn’t work…
.full-color {
background-color: var(–color-base-background-2);
}
.full-color {
background-color: {{ settings.colors_background_2 }} !important;
}
Thanks!!
Erika
@erikapruett
Hi,
When you make the custom.css file, make the file name to custom.css.liquid to let the code below working.
.full-color {
background-color: {{ settings.colors_background_2 }} !important;
}
Don’t forget to add tag
{{ ‘custom.css’ | asset_url | stylesheet_tag }}
in theme.liquid file.
Or you can add the code in the theme.liquid file inside {% style %} tag as below.
{% style %}
.full-color {
background-color: {{ settings.colors_background_2 }} !important;
}
{% endstyle %}
Hope it helps.