🔹 Card-mod - Add css styles to any lovelace card

You can add margin: edits directly under for button cards.

styles:
    card:
      - margin: 0px
type: custom:button-card
      entity: light.bathroom_lights
      show_name: true
      name: Card Example
      icon: mdi:lamp
      aspect_ratio: 2/1
      tap_action:
        action: toggle
      styles:
        card:
          - background-color: blue
          - margin: 0px
        icon:
          - height: 100%
          - color: orange

check out