you really shouldnt give up, because it will be helpful to be able to use anchors and those includes/secrets for you all throughout your config, not just here. let’s consider this:
- type: custom:fold-entity-row
head:
type: section
label: Switch PoE Cams
card_mod: &style # <----- create anchor (note: all under this anchor is indented 2 spaces extra)
style: |
.label {
margin-left: 0px;
}
<<: &config # <----- create another anchor
group_config:
secondary_info: last-changed
padding: 0
entities:
- entity: switch.switch_48_poe_port_5_poe
name: Logeerkamer
- entity: switch.switch_48_poe_port_7_poe
name: Voorkamer
- type: custom:fold-entity-row
head:
type: section
label: Switch Netwerk
card_mod: *style # <----- paste anchor
<<: *config # <----- paste another anchor
as you can see, the &xxxx creates the anchor, and the *xxx copies that exact same bit of yaml. You can put anything under an anchor, as longs as it the correct hierary, and the complete section. you can not insert bits and pieces.
these anchors can only be used inside a single yaml file, they are defined locally to that specific file
what Ildar helped you with even further with is when you’d safe that specific piece of yaml in the secrets file like
# Card_mod stylings frequently used
style_margin: >
style: |
.label {
margin-left: 0px;
}
and then inject that exact piece of yaml (the below/section after the ‘>’) into the dashboard card:
- type: custom:fold-entity-row
head:
type: section
label: Switch PoE Cams
card_mod: !secret style_margin #<-----
<<: &config
group_config:
secondary_info: last-changed
padding: 0
entities:
- entity: switch.switch_48_poe_port_5_poe
name: Logeerkamer
- entity: switch.switch_48_poe_port_7_poe
name: Voorkamer
- type: custom:fold-entity-row
head:
type: section
label: Switch Netwerk
card_mod: !secret style_margin #<-----
<<: *config
you could also do it the hard way, and create card-mod theme classes
card-mod-card-yaml: |
.: |
ha-card.class-header-margin-no-color .card-header {
font-weight: 400;
font-size: 20px;
padding: 0px 12px;
margin: 0px 0px 16px 0px;
}
and then use that class inside an entities card like:
type: entities
title: Stroom gebruik overzicht
state_color: true
card_mod:
class: class-header-margin-no-color
and not have to repeat that anywhere, just inject the class. It’s a lot more involved though required to setup those themes and card_mod_theme being using inside your themes. Powerful, but complex.
the anchor and secret ways are much simpler. Why dont you give it another try.