# Get colour from module field for css

**URL:** <https://community.hubspot.com/t/get-colour-from-module-field-for-css/23038>\
**Category:** CMS Development\
**Created:** [July 17, 2020, 2:20pm UTC](https://community.hubspot.com/t/get-colour-from-module-field-for-css/23038 "2020-07-17T14:20:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SandyG1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sandyg1/32/77083_2.png) [@SandyG1](https://community.hubspot.com/u/SandyG1)\
**Post date:** [July 17, 2020, 2:20pm UTC](https://community.hubspot.com/t/get-colour-from-module-field-for-css/23038/1 "2020-07-17T14:20:59Z")

</div>

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

module.css

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

```

fields.json

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

```

![29343iA50F4A0F4BFCAEEE.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/a/fad46032c22fa44f0797967ec23af0cd569eadcc.png)

---

<div class="post-metadata">

**Author:** ![SandyG1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sandyg1/32/77083_2.png) [@SandyG1](https://community.hubspot.com/u/SandyG1)\
**Post date:** [July 17, 2020, 2:36pm UTC](https://community.hubspot.com/t/get-colour-from-module-field-for-css/23038/2 "2020-07-17T14:36:02Z")

</div>

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
