Lovelace: Decluttering Card

Read in card-mod docs about mod-card.
You need to place your card inside mod-card and style it.

Thanks for the quick reply Ildar.
I’ve tried with the mod-card following your suggestion, but still no luck. Not sure what I’m doing wrong. This is the current code:

  template_device_colored_icon:
    card:
      type: custom:mod-card
      card_mod:
        style: |
          :host {
            --card-mod-icon-color: 'green'
          }
      card:
        type: custom:template-entity-row
        entity: '[[entity]]'
        name: '[[name]]'
        icon: '[[icon]]'

I do not think you can use this css variable here. But try removing quotes around a value.
Also, the template-entity+row has its own “color” option.

Yay! Thank you! Removing the quotes did the trick.

However I don’t understand why for non-decluttering card it works with quotes. I mean, the code is copied from the working version without decluttering.

Cannot tell. In my observations, quotes may be converted in a browser/companion app in to some “other quotes” that are wrongly processed.