Dawn Theme 5.0 For a new section, is there standard code that I can use to add color scheme?

Dawn Theme 5.0

Is there “standard” or repetitive code that I can re-use to add a color scheme to a new section and be able to select the color scheme via drop down list I want when I Customize that section? Similar to what you do with any standard section on the home page which was included with Dawn.? I created a new section product-slider.liquid and it’s white and I would like to be able to customize the color scheme. (to either Accent_1, Accent_2, Background_1 etc.)

I found code for the Schema portion which I think is correct as follows:

“settings”: [
{
“type”: “select”,
“id”: “color_scheme”,
“options”: [
{
“value”: “accent-1”,
“label”: “t:sections.all.colors.accent_1.label”
},
{
“value”: “accent-2”,
“label”: “t:sections.all.colors.accent_2.label”
},
{
“value”: “background-1”,
“label”: “t:sections.all.colors.background_1.label”
},
{
“value”: “background-2”,
“label”: “t:sections.all.colors.background_2.label”
},
{
“value”: “inverse”,
“label”: “t:sections.all.colors.inverse.label”
}
],
“default”: “background-1”,
“label”: “t:sections.all.colors.label”
},

My shop is websitelements.myshopify.com

password ENTER

Thank you.

Hi @Smiley1311 ,

You need to know a little HTML and CSS to do this. You have to find the main container or the div you want to apply the background and add the style. Please refer to the code below


After that, add the schema under the settings. You can just replace the color scheme. After the code below. Make sure you are under the section and not the blocks

"settings": [

Paste this code below. This will add a color picker in your theme editor

{
"type": "color",
"id": "background",
"label": "Background color",
"default": "#eee"
}