Why is the color variable value empty in my settings?

First we created a Variable (in the Color Settings).

config/settings_schema.json

{
        "type": "color",
        "id": "bg_col_orange",
        "label": "Slider Background",
        "default": "#3f4b57"
      },

Then we safed this color in it.

config/settings_data.json

"bg_col_orange": "#de7427",

And then we wanted to use this variable to set a background color.

assets/styles.css.liquid

background: {{ bg_col_orange }};

(Maybe) the value of the variable is “empty” but there is no color set in it. There is no background set.

@Sara98

You have to call it like below if you have added the color setting in config/settings_schema.json

background: {{ settings.bg_col_orange }};


If helpful then please Like and Accept Solution. Want to modify or custom changes on store Hire me. Feel free to contact me on shopify.dev.34@gmail.com | Shopify Design Changes | Custom Modifications In to Shopify Theme

2 Likes

Thank you, it was very helpful.

1 Like