Class Toggle and Opacity

Hi All

I am trying to change the opacity of an icon depending on a certain value . I want to make it appear as greyed out if the value of a status field does not equal 2.
I have tried various combinations using style and toggle class, but can’t figure it out. Do I need to create a class containg the opacity values then toggle that ? I’m still getting to grips with cusotm CSS so may have missed something obvious

You can add dynamic class binding for the opacity and background colour like this. This code will evaluate value of status and if its value is 2, the dynamic CSS classes will be applied accordingly.

dmx-class:bg-opacity-10="status==2" dmx-class:bg-primary="status==2"

1 Like