I was wondering if you can use a gradient picker in a module’s style field? I was able to add this to the module’s field.json to add it to the module:
{
“name”: “bg_gradient”,
“label”: “Background gradient”,
“helptext”: “Sets a gradient behind the content”,
“required”: false,
“type”: “gradient”,
“default”: {
“colors”: [{
“color”: {
“r”: 29,
“g”: 114,
“b”: 170,
“a”: 1
}
}, {
“color”: {
“r”: 57,
“g”: 67,
“b”: 151,
“a”: 1
}
}],
“side_or_corner”: {
“verticalSide”: “BOTTOM”,
“horizontalSide”: null
}
}
}
The issue is that the output from Hubl is:
{colors=[{color={r=153, g=1, b=0, a=1}}, {color={r=120, g=63, b=4, a=1}}], side_or_corner={verticalSide=BOTTOM, horizontalSide=null}, css=linear-gradient(to bottom, rgba(153, 1, 0, 1), rgba(120, 63, 4, 1))}
I was wondering how this can be used in the css to give a background the gradient styles? Thanks.


