Changing modal background color dynamically

Im trying to change the background color and text color of a modal dynamically based on the content being retrieved. I’m trying to add a dynamic attribute: style, name: background-color and then value: #fff. Is that right? doesn’t seem to work.

Thanks,
Rick

Hi Rick,

Use ‘Toggle Class’ Dynamic Attribute instead of ‘Style’ Dynamic Attribute.

that does work but can I use style? I have about 13 different colors based on the value of the data so only want to have one style statement rather then 13 class toggles.

Thanks,

Give the modal an ID or CLASS according to the content. Use that ID/CLASS as the CSS selector for the background (or any other) style.

thank you!!! that worked perfectly.

1 Like