How do I display colorized html text in Markdown card?

nope.
well, we can, with <font> but no modern css way that I could think of.

btw, I changed the above to

          ha-markdown $: |
            {% set kleur = states('sensor.buienradar_contrast_kleur') %}
            h3 {color: {{kleur}};}
            b {color: {{kleur}};}

which is kind of a nice touch, so templates work there also :wink:
the colors needed to be adjusted to the theme, so I figured I make a template

template:

  - trigger:  #needs fix

      trigger: state
      entity_id: input_select.theme

    sensor:
      - unique_id: buienradar_contrast_kleur
        state: >
          {% set dark = states('input_select.theme') is search('ight|Dark|Matrix',ignorecase=True) %}
          {{'#e2eff8' if dark else '#152b81'}}

#buienradar dark color #152b81 rgb(21,43,129)
#buienradar light color #e2eff8 rgb(226,239,248)

and have that take care of it

1 Like