Animation of Mushroom Chip card Template

I’m using mushroom chip card to display the connection status of my router. Currently the background color of the chip is based on the sensor state (blue for connected and red for disconnected). I would like to animate the disconnected state so that it blinks in red.
Unfortunately, I can’t get it to work. Please kindly assist, the code is below:

type: custom:mushroom-chips-card
chips:
  - type: template
    entity: sensor.vigor_router_wan_status
    icon: mdi:wan
    content: '{{ states(''sensor.vigor_router_wan_status'') }}'
    tap_action:
      action: more-info
    card_mod:
      style: |
        {% if is_state('sensor.vigor_router_wan_status','Connected') %}
        ha-card {
          --chip-background: blue 
          }
        {% else %}
        ha-card {
          --chip-background: red }
        {% endif %}
alignment: center

Can you try this :

    card_mod:
      style: |
        ha-card {
          {% if is_state('sensor.vigor_router_wan_status','Connected') %}
          --chip-background: blue;
          {% else %}
          --chip-background: red;
          {% endif %}
        }

It worked for me