thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.04k stars 169 forks source link

Icon color doesn't work after update #357

Open evirci opened 4 months ago

evirci commented 4 months ago

My Home Assistant version: Core 2024.2.1 Supervisor 2024.01.1 Operating System 11.5 Frontend 20240207.1 My lovelace configuration method (GUI or yaml):

What I am doing: After upadate Core,the color of this icon doesn't work. this is a bug or am i wrong?

type: horizontal-stack
cards:
  - type: tile
    entity: sensor.aria_pm25
    name: PM 2.5
    show_entity_picture: false
    card_mod:
      style:
        .icon-container .icon$: |
          .shape { 
            border-radius: 15px !important;
            background:
              {% if states('sensor.aria_pm25')|float(0) >= 125|float(0) -%}
                rgba(255,0,0,0.6)
              {% elif states('sensor.aria_pm25')|float(0) >= 60|float(0) -%}
                rgba(255,165,0,0.8)
              {% elif states('sensor.aria_pm25')|float(0) >= 0|float(0) -%}
                rgba(60,179,113,0.6) 
              {% endif %} !important; 
          }
  - type: tile
    entity: sensor.aria_voc_index
    name: VOC Index
    icon: mdi:chart-bell-curve-cumulative

What I expected to happen: The color of the icon change when the sensor change state What happened instead: The icon is all time grey


By putting an X in the boxes ([]) below, I indicate that I:

ildar170975 commented 4 months ago

Wrong DOM path defined by a user, not a bug.