Change badge color based on state

I have several badges on top of my lovelace dashboard to show the state of several doors. The icon changes based on the door state but that’s hard to see. Is there a way to change the badge outline to a different color when the door is open as when it’s closed?

Install card mod and have a read of this post:

1 Like

That works great with a badge I´ve been wanting to customize for some time however I do have a question, can the text and icon be swapped out the same way? :slight_smile: