custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.97k stars 242 forks source link

- display: none leaves a gap where the card was #866

Closed warmfire540 closed 3 months ago

warmfire540 commented 3 months ago

Checklist

Describe the bug I have a card that hides itself when not needed using the state/styles option.

Version of the card Version: 4.1.2

To Reproduce This is the configuration I used:

state:
  - operator: "template"
    value: "[[[ return variables.optional && entity.state != variables.on_state && (isNaN(entity.state) || entity.state == 0); ]]]"
    styles:
      card:
        - display: none

Screenshots image

image

Expected behavior I would like their to not be a gap, or a way to apply styles to the parent hui-card element to have that display: none

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

warmfire540 commented 3 months ago

nevermind - this was a problem w/ the horizontal-stack. fixed w/ following yaml

- type: custom:mod-card
      style:
        hui-horizontal-stack-card$: |
          #root { 
            justify-content: center;
            --stack-card-gap: 0;
          }
      card:
        type: horizontal-stack
        cards: