Card-mod - return to default card background

I’m using card-mod to change the background of a card dependent to the entity’s state:

card_mod:
  style: |
    :host {
      {% if is_state('switch.w2_waschmaschine_fertig', 'on') %}
      --ha-card-background: lightgreen;
      {% elif is_state('switch.w2_waschmaschine_fertig', 'off') %}
      --ha-card-background: [default]
      {% endif %}
      }

What i’s looking for is the term i should use instead of the placeholder [default]. I want the background to return to default color.
This is diffenet in different themes, so i can’t use “black” or “white”.

Define ONE style only with the 1st condition. If false - nothing will be changed.

1 Like