I wanted to make it a string - otherwise it will not pass as a variable.
great, thank you so much!!!
Some more working options:
- type: 'custom:decluttering-card'
template: test_decl_entity_row
variables:
- SENSOR: sun.sun
- NAME: colored name
- STYLE:
hui-generic-entity-row$: '.info.pointer.text-content { color: cyan; }'
- type: 'custom:decluttering-card'
template: test_decl_entity_row
variables:
- SENSOR: sun.sun
- NAME: colored name & value
- STYLE:
hui-generic-entity-row$: '.info.pointer.text-content { color: green; }
.text-content:not(.info) { color: orange; }'
decluttering_templates:
test_decl_entity_row:
card:
type: entities
entities:
- entity: '[[SENSOR]]'
name: '[[NAME]]'
card_mod:
style: '[[STYLE]]'

These options I found by chance - Lovelace editor generates that yaml after saving the code in your format.
And I do not understand why does it work - I believed that there must be smth like “|” or “>” after the “STYLE:” word.
More examples are described here.