Set Dynamic CSS value by Object Attribute string value?

I was pretty sure you could set CSS attribute values by the attribute value of an entity object, but I can't find again how to set this up. Let's say you have a Status object with the attribute 'Hex (string)' that contains '#f08245', then that value should be applied to the sibling/specified DOM element as 'color'. So my DOM element get's the CSS values 'Color: #f08245'. Note: I want to use string values, not enum's. I thought this could be done with CSS selector helper widget or EnumClass, but I haven't been able to. Am I missing something or does anyone have an idea how to make this happen?
2 answers

You can use a snippet of javascript to handle this. The JavaScript Snippet widget in the app store is your best bet. Here's a simple example:

Configure the JavaScript Snippet (Data Source) widget with the JS below and be sure to set up a variable. = 'color:${Color}'

This code adds the "color" style to the JS snippet's sibling. So in a setup like this:

You get results like this:

or this:


With the EnumClass app store widget you can set an enum value to a certain class, which holds your custom css. May that is what you are looking for?