Widget style background active/inactive

Hello

Have been searching all morning for a solution but I still can not find an answer which I understand.
I would like to have the background of a whole tile (switch, sensor, light) to change when active. Something like:

switch_widget_style_active and switch_widget_style_inactive.

As I dont see anything in the docs about it (if I have missed pls point me to the correct place) has anyone achieved this in another way and if so how?