How to increase the gap between these two cards?

How can I increase the gap between these two cards, when using vertical stack card?

Clipboard_02-08-2025_02

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).

Maybe GitHub - thomasloven/lovelace-gap-card: 🔹 A lovelace card that does nothing and looks like nothing. Incredibly useful! No, really.

Use card-mod to increase a gap between cards. Details in the main card-mod thread.

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:

@WallyR This card says “depreciated” now?

I did not notice.
Thanks for the hint. I will stop pushing it then. :slight_smile: