Follow-up to #25843 (frontend state color theme variables) (#25934)

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
This commit is contained in:
Philip Allgaier 2023-01-25 15:26:06 +01:00 committed by GitHub
parent 0235ecae95
commit 7d6ac8de43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,18 +76,18 @@ They can be changed it using `primary-color` and `accent-color` variables.
#### State color #### State color
Each entity has its own color, based on `domain`, `device_class`, and `state`, to be easily recognizable. Theses colors are used in [dashboards](/dashboards/) and [history](/integrations/history/). Home Assistant has default rules that fit most use cases. Each entity has its own color, based on `domain`, `device_class`, and `state`, to be easily recognizable. Theses colors are used in [dashboards](/dashboards/) and [history](/integrations/history/). Home Assistant has default color rules that fit most use cases.
Here is a list of domains that support colors: `alarm_control_panel`, `alert`, `automation`, `binary_sensor`, `calendar`, `camera`, `climate`, `cover`, `device_tracker`, `fan`, `group`, `humidifier`, `input_boolean`, `light`, `lock`, `media_player`, `person`, `plant`, `remote`, `schedule`, `script`, `siren`, `sun`, `switch`, `timer`, `update`, and `vacuum`. Here is a list of domains that support colors: `alarm_control_panel`, `alert`, `automation`, `binary_sensor`, `calendar`, `camera`, `climate`, `cover`, `device_tracker`, `fan`, `group`, `humidifier`, `input_boolean`, `light`, `lock`, `media_player`, `person`, `plant`, `remote`, `schedule`, `script`, `siren`, `sun`, `switch`, `timer`, `update`, and `vacuum`.
These rules can be customized using theme variables: The color rules can be customized using theme variables:
1. `state-{domain}-{device_class}-{state}-color` 1. `state-{domain}-{device_class}-{state}-color`
2. `state-{domain}-{state}-color` 2. `state-{domain}-{state}-color`
3. `state-{domain}-(active|inactive)-color` 3. `state-{domain}-(active|inactive)-color`
4. `state-(active|inactive)-color` 4. `state-(active|inactive)-color`
Note that if multiple properties match your entity, the first one will be used in this order. Note that the variables will be used in the listed order, so if multiple match your entity, the first matching variable (= most specific one) will be used.
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry