Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106561

Card-Mod Help With Icon Color

$
0
0

Hey All,

I’m currently using the card-mod repo to change the color of the text in a card depending on the state. What I can’t figure out is how to get the icon to change colors as well. I see how to change it to one color but not how to include it here. Here is the code I have to change the text:

  - entity: sensor.allergy_index_today
    card_mod:
      style: |
        :host {
          color:
            {% if states(config.entity) | int <= 2.4 %} 
              green
            {% elif states(config.entity) | int <= 4.8 %}
              greenyellow
            {% elif states(config.entity) | int <= 7.2 %}
              yellow
            {% elif states(config.entity) | int <= 9.6 %}
              orange
            {% elif states(config.entity) | int <= 12 %}
              red
            {% endif %}
            ;
        }

Thank you in advance for your time.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>