shalak
December 8, 2022, 5:49pm
1
I have the following markdown card:
type: markdown
content: >-
# <center>
Salon
{% if is_state('binary_sensor.okno_salon_contact', 'on') %}
<ha-icon icon='mdi:window-open-variant'/>
{% else %}
{% endif%}
</center>
style: |
ha-icon {
fill: #F5C344;
}
Unfortunately, the style is not applied to the ha-icon
. How can I “catch” it with CSS? Tried ha-svg-icon
, icon
, svg
(all of which works in devtools) - no luck.
Any ideas?
pedolsky
(Pedolsky)
December 8, 2022, 10:32pm
2
<font color='#F5C344'><ha-icon icon='mdi:window-open-variant'/>
3 Likes
shalak
December 9, 2022, 12:02am
3
Thank you! That did the trick. I didn’t even know that SVG graphics are considered fonts.
type: markdown
content: >-
# <center>
Salon
{% if is_state('binary_sensor.okno_salon_contact', 'on') %}
<font color='#F5C344'><ha-icon icon='mdi:window-open-variant'/></font>
{% else %}
{% endif%}
</center>
pedolsky
(Pedolsky)
December 9, 2022, 5:58am
4
For more information see here: Markdown Card - Home Assistant
(The alert
function is also nice).