CMS Development

SandyG1
Contributeur | Partenaire solutions
Contributeur | Partenaire solutions

Get colour from module field for css

Résolue

 

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 Votes
1 Solution acceptée
SandyG1
Solution
Contributeur | Partenaire solutions
Contributeur | Partenaire solutions

Get colour from module field for css

Résolue

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

Voir la solution dans l'envoi d'origine

1 Réponse
SandyG1
Solution
Contributeur | Partenaire solutions
Contributeur | Partenaire solutions

Get colour from module field for css

Résolue

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