Struggling with animation with card mod.
This code works as expected:
type: entities
entities:
- type: custom:template-entity-row
entity: switch.pool_r1
icon: mdi:pump
card_mod:
style:
div#wrapper: |
state-badge {
animation: rotation 2s linear infinite, colorize 5s linear forwards 1;
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes colorize {
0% {
background: yellow;
}
100% {
background: yellow;
}
}
BUT this code don’t:
type: custom:template-entity-row
entity: switch.pool_r1
icon: mdi:fan
card_mod:
style:
div#wrapper: |
state-badge {
{% if is_state('switch.pool_r1', 'on') %}
animation: rotation 2s linear infinite, colorize 5s linear forwards 1;
{% endif %}
}
@keyframes rotation {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes colorize {
0% {
background: yellow;
}
100% {
background: yellow;
}
}
Yaml is valid but animation don’t work.
Can anyone give a hint what’s missing.