CMS Development

SandyG1
投稿者 | Solutions Partner
投稿者 | Solutions Partner

Get colour from module field for css

解決

 

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 いいね!
1件の承認済みベストアンサー
SandyG1
解決策
投稿者 | Solutions Partner
投稿者 | Solutions Partner

Get colour from module field for css

解決

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

元の投稿で解決策を見る

1件の返信
SandyG1
解決策
投稿者 | Solutions Partner
投稿者 | Solutions Partner

Get colour from module field for css

解決

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