[bubble-card] Change color depending on state

My code doesn’t work in a Bubble card.

I have a sensor called: “binary_sensor.snickers”, and i the sensor state should be “Inde” or “Ude”.

I have tried to make the card green if the state is “Inde” and red if the state is “Ude”.

But the card is green no matter what.

Se yalm and picture:

type: custom:bubble-card
card_type: button
entity: binary_sensor.snickers
button_type: switch
icon: mdi:cat
show_icon: true
force_icon: false
show_state: true
show_last_changed: true
show_attribute: true
card_mod:
style: |
ha-card {
–primary-text-color: {{ ‘red’ if is_state(‘binary_sensor.snickers’, ‘Ude’) else ‘green’ }};
}

Hi, your indentation seems wrong.
Post your YAML as code: the </> button in the reply window.