How to use the class property in the TreeList widget

Hi,

I believe this is a simple question for somebody with more knowledge in css as I have.

I use the TreeList widget in one of my custom nodes:

image

Now I like to highlight certain elements/lines by changing the background color for example (indicate offline devices or miss configured properties.

I think it should be possible by the class property, but how?

Chris

After learning something new ... It is actually quite easy

Define the style(s) in your node.html

   <style>
      .homie-ready {
        background-color: #1f7a1f;
      }
      .homie-lost {
        background-color: #AD1625;
      }
      .homie-sleeping {
        background-color: #4682B4;
      }
      .homie-init {
        background-color: #66CDAA;
      }
      .homie-disconnected {
        background-color: #696969;
      }
      .homie-alert {
        background-color: #FFFF00;
      }
      .homie-undefined {
        background-color: #ffcc00;
      }
    </style>
class: `homie-${device.$state}`
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.