I was wondering if it's possible to change the color of a background dynamically with variables
Andreas Møller
1 year ago
Yes you Can use style variables
👍1
Andreas Møller
1 year ago
Create a style variable at the top of the style panel, the use it fir Setting the bg
GumoAndreatta
1 year ago
but if possible to change it with a formula or something ? I'm trying to change the background-color depending the location of the user but I'm not sure how to do it
yoelfdz
1 year ago
Get the location of the customer through API, create a style variable on the div you want to but the backgroung on and set up if conditions. Example, if location equals UK background #777b83, else if locations equals ES... and repeat that
👍1
yoelfdz
1 year ago
You can create a custom formula to simplify that or you could store the location and color combinations in a object variable and use that