CMS Development

SandyG1
Colaborador | Partner
Colaborador | Partner

Get colour from module field for css

resolver

 

Is there any reason why the below wouldn't work? Is this even possible?

 

module.css

footer{
    background-color: {{ module.background_color.color }};
}

fields.json

 

{
   "label" : "Background",
    "locked" : false,
    "name" : "background_color",
    "required" : false,
    "type" : "color",
    "default" : {"color" : "#F8F8F8"},
    "visibility" : {
        "hidden_subfields" : {
            "opacity" : true
        }
    }
},

chrome_YjKbqmwp7q.png

0 Me gusta
1 Soluciones aceptada
SandyG1
Solución
Colaborador | Partner
Colaborador | Partner

Get colour from module field for css

resolver

Answer:

 

Module CSS can not contain variables. If the module is used once and is global, then maybe try putting it in the theme fields.json and get it at a global level

Ver la solución en mensaje original publicado

1 Respuesta 1
SandyG1
Solución
Colaborador | Partner
Colaborador | Partner

Get colour from module field for css

resolver

Answer:

 

Module CSS can not contain variables. If the module is used once and is global, then maybe try putting it in the theme fields.json and get it at a global level