Update: I noticed you asked about card-header.
I updated that post, styles have to be changed - .card-header went deeper into shadowRoot (probably this change).
In short, this added some rounding to the header and footer rows and gave alternating rows differing colours.
Iāve inspected the DOM and I can only see a top-level <card-mod>, which probably means I canāt style any inner elements anymore, unless thereās some trick Iām missing.
I can still apply something like a scrollbar via this top-level element, but canāt seem to reach anything else. The last example of markdown card changes is one by Mariusthvdb and some comments by Ildar, but thatās prior the UI updates.
Is this kind of change definitely not possible anymore?
Not so sure about that, Ive never used the ha-markdown-element: yet, but, just this day, no such thing as coincidence, I wondered if we could card_mod per section in a markdown card. Is that what this does?
because if so, Id love to be able to change this mod:
- type: markdown
content: |-
<p>Read:</p>
<p>The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.<br>
The quick brown fox jumps over the lazy dog.</p>
End!
card_mod:
style:
ha-markdown $: |
p:nth-child(2) {
max-height: 200px;
overflow-y: auto;
}
I know. And the reason for quoting it as well. And the hint to check template playground in dev-tools.
Helping people help themselves. And as he already replied with thanks and heart, it was solved already.
those templates can be made a lot simpler, and cut all that repetitive code, try something like this:
{% set status = states('alarm_control_panel.9000_aaa_zone_1_alarm') %}
{% set colors = {'disarmed':'red','armed_away':'blue','armed_night':'green'} %}
{{colors.get(status,'yellow')}}
that Is a cool mod, and yes, I get it to work on actual lines of text. However, using that on a template returning a long list if text doesnt work.
I did play around bit in the markdown, as adding a white line here or there makes a lot of difference. I could not get it to get better than this though: