Condition in CSS style (text node)

With Dashboard v3 you can use msg.className to set a custom class for the node.

So you need a template node with a little CSS

<style>
md-card.nr-dashboard-text.on {
    background-color: red;
}
md-card.nr-dashboard-text.off {
    background-color: slategrey;
}
</style>

Then when you send some text to the node, also set msg.className to "on" or "off".
You can do that based on the contents of msg.payload or a context variable as you wish, using a Function or Change node.

1 Like