Change text color

I have interfaced APC SmartUPS and got this:

type: entities
entities:
  - entity: sensor.ups_system_identifier
    name: System identifier
  - sensor.ups_status
  - entity: sensor.ups_input_voltage
    name: Input Voltage
  - entity: sensor.ups_load
    name: Load
  - entity: sensor.ups_output_voltage
    name: Output Voltage
  - entity: sensor.ups_status_data
    name: Status Data
title: UPS Status
state_color: false
theme: Dark-Gray

How can I change ā€˜sensor.ups_status_dataā€™ to color ā€˜redā€™ when its value goes from OL ā†’ BL

Firefox_Screenshot_2022-07-03T14-35-31.862Z

Go to card-mod thread.

Thanks ā€¦ it worked.

type: entities
entities:
  - entity: sensor.ups_system_identifier
    card_mod:
      style: |
        :host {
          color: yellow;
          }
    name: System identifier
  - sensor.ups_status
  - entity: sensor.ups_input_voltage
    name: Input Voltage
  - entity: sensor.ups_load
    name: Load
  - entity: sensor.ups_output_voltage
    name: Output Voltage
  - entity: sensor.ups_status_data
    card_mod:
      style: |
        :host {
          color: red;
          }
    name: Status Data
title: UPS Status
state_color: false
theme: Dark-Gray

Still I havenā€™t figured out how to set condition for color change ā€¦

Take a look at the construction of this post: šŸ”¹ Card-mod - Add css styles to any lovelace card - #3000 by Ildar_Gabdullin. I think you can something similar for the text?

Iā€™m starting to get to grips with style BUT no matter what, I cannot seem to change font colour. What am I missing here?

type: tile
card_mod:
  style: |
    ha-card {
      color: yellow;
      border: 3px solid cyan;
      background-color: #002200;
    }
entity: switch.lidlplug_1_flies
name: Fly zapper
color: light-blue
icon: mdi:bacteria-outline

This property defined on the ā€œha-cardā€ level cannot be used blindly for ANY card, ANY cardā€™s element. In some cases you have need to define a color for a PARTICULAR element (in your example - either for a name or a state).

Nearly, but no. Stumbled on this which WORKS -

. Someone used --secondary-text-color so I blindly tried --primary-text-color - and it works!
Now, as you rightly indicate it woudld be nice to separate name from state, but various cominations of the above to include state and name failed - ideas pleaseā€¦
Ignore the unavailable, wife pulled out the plugā€¦

Just a hint:
12.06.2024_15.06.13_REC