How can I increase the gap between these two cards, when using vertical stack card ?
type: vertical-stack
cards:
- show_name: true
show_icon: true
type: button
entity: input_boolean.baby_sleeping
- show_name: true
show_icon: true
type: button
entity: switch.toggle_electric_gates
I don’t know if I’m missing something silly, but I’ve searched all over the forums and can’t seem to do this. I’ve tried adding “card-mod” to the styling, but it seems to make no difference (unless I’m just doing something wrong).
WallyR
(Wally)
February 8, 2025, 8:07pm
2
Use card-mod to increase a gap between cards. Details in the main card-mod thread.
teeeeee
February 10, 2025, 10:35pm
4
Great, this actually does work, I must have been putting the card-mod code in the wrong place.
Here is the working code:
type: vertical-stack
cards:
- show_name: true
show_icon: true
type: button
entity: input_boolean.baby_sleeping
- show_name: true
show_icon: true
type: button
entity: switch.toggle_electric_gates
card_mod:
style: |
ha-card {
margin-top: 100px;
}
Note, it seems like you need a slightly different approach if you are using an entities card. Something like this perhaps:
teeeeee
February 10, 2025, 10:36pm
5
@WallyR This card says “depreciated” now?
WallyR
(Wally)
February 11, 2025, 8:53am
6
I did not notice.
Thanks for the hint. I will stop pushing it then.