Skip to content

Commit

Permalink
added theme variable to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusthvdb authored Feb 9, 2021
1 parent 12714d7 commit 01ef136
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ homeassistant:
if (state == 'on') return 'gold';
return 'steelblue';
# or use a theme variable:

templates: &state_color
icon_color: >
if (state == 'on') return 'var(--primary-color)';
return 'steelblue';
binary_sensor:
templates:
<<: *state_color # <-- and use it on any other entity in this file
Expand Down

0 comments on commit 01ef136

Please sign in to comment.