custom-cards / bar-card

Customizable Animated Bar card for Home Assistant Lovelace
MIT License
379 stars 54 forks source link

Text Color #171

Open cataseven opened 1 year ago

cataseven commented 1 year ago

Hi,

I want to change the text color of 3 out of 4 bar. When I use below code nothing happens and text color remains as primary color (white) for the first bar;

type: custom:bar-card
entity_row: false
entities:
  - entity: sensor.epson_l5290_series_black_ink
    severity:
      - from: '21'
        to: '100'
        color: Black
      - from: '20'
        to: '0'
        color: Red
    name: Black
    positions:
      icon: 'off'
      indicator: inside
    height: 30
    **style: |-
      bar-card-name {
        color: black;
      }**
  - entity: sensor.epson_l5290_series_cyan_ink
    severity:
      - from: '21'
        to: '100'
        color: Cyan
      - from: '20'
        to: '0'
        color: Red
    name: Cyan
    positions:
      icon: 'off'
      indicator: inside
    height: 30
...
....
.....
....

When I use below code, it changes 4 of them to white. This is ok.

type: custom:bar-card
entity_row: false
**style: |-
  bar-card-name {
    color: black;
  }**
entities:
  - entity: sensor.epson_l5290_series_black_ink
    severity:
      - from: '21'
        to: '100'
        color: Black
      - from: '20'
        to: '0'
        color: Red
    name: Black
    positions:
      icon: 'off'
      indicator: inside
    height: 30
  - entity: sensor.epson_l5290_series_cyan_ink
    severity:
      - from: '21'
        to: '100'
        color: Cyan
      - from: '20'
        to: '0'
        color: Red
    name: Cyan
    positions:
      icon: 'off'
      indicator: inside
    height: 30