From 01ef1369c8ca3211f4494e17df4082ead42083e4 Mon Sep 17 00:00:00 2001 From: Marius <33354141+Mariusthvdb@users.noreply.github.com> Date: Tue, 9 Feb 2021 08:44:11 +0100 Subject: [PATCH] added theme variable to examples --- examples.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples.md b/examples.md index 2438aa5..8de9b1e 100644 --- a/examples.md +++ b/examples.md @@ -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