If you put the card with the Card Mod customisations in a sections
layout, it will work. However, if you put it inside of a horizontal-stack
, apparently card-mod won’t work.
Example - in a sections
layout, I have this:
type: entities
show_header_toggle: false
state_color: false
grid_options:
columns: 2
entities:
- entity: <input_boolean entity>
name: ""
icon: mdi:blank
card_mod:
style:
hui-generic-entity-row $: |
state-badge, .info {
display: none;
}
.: |
hui-generic-entity-row {
justify-content: center;
}
card_mod:
style: |
ha-card {
height: 56px !important;
justify-content: center !important;
background: transparent !important;
border: none
}
#states {
padding-left: 0;
padding-right: 0;
}
It will render just fine like this:

(not including the code for the cards on the left here).
However, if I put these 2 cards on a horizontal-stack
, like this:
type: custom:layout-card
layout_type: custom:grid-layout
layout:
grid-template-columns: 10fr 2fr
grid-template-rows: none
grid-template-areas: |
"left right"
cards:
- <first card here>
view_layout:
grid-area: left
- type: entities
view_layout:
grid-area: right
show_header_toggle: false
state_color: false
entities:
- entity: <input_boolean entity>
name: ""
icon: mdi:blank
card_mod:
style:
hui-generic-entity-row $: |
state-badge, .info {
display: none;
}
.: |
hui-generic-entity-row {
justify-content: center;
}
card_mod:
style: |
ha-card {
height: 56px !important;
justify-content: center !important;
background: transparent !important;
border: none
}
#states {
padding-left: 0;
padding-right: 0;
}
I’ll get this:

Notice properties height
, background
, and border
got ignored.
The inner most card_mod
style works 100%.
Card-mod 3 docs says:
NOTE: card-mod only works on cards that contain a ha-card element. This includes almost every card which can be seen, but not e.g. conditional, entity_filter, vertical-stack, horizontal-stack, grid.
Note, though that those cards often include other cards, which card-mod can work on.
See the manual for each card to see how to specify parameters for the included card(s).
EDIT: I don’t think that’s the issue, though. Something changes when it is inside a layout-card
. I couldn’t find what it is.
Maybe I’m doing something stupid, though.
Thanks again for helping. Highly appreciated.