Change font and icon color of entities based on template

Use this example to adjust your current card.

type: entities
entities:
  - entity: sun.sun
    name: System armed
    card_mod:
      style:
        hui-generic-entity-row:
          $: |
            state-badge {
              color:  {{ 'red' if states('sensor.pirateweather_temperature') | int >= 20 else 'green' }};
                 }
            .info {
              color: orange;
              }
            .state {
              color: lime;
              }

check out this full guide