nathan-gs / ha-map-card

A Map Card for Home Assistant
https://community.home-assistant.io/t/map-card-a-slightly-improved-map-card/693088
MIT License
19 stars 4 forks source link

[FR] Support an adaptive auto-size in a panel view layout #11

Closed ildar170975 closed 3 months ago

ildar170975 commented 3 months ago

Currently a user can define a size of a card by card_size option. In a Panel view layout by default a card may occupy only a small part of available area:

изображение

To fit a map to a view, a user has to define a value of card_size dependently on a particular viewport (which can be different o different clients). Suggest to add a special value for card_size to force the card to occupy a whole available area.

nathan-gs commented 3 months ago

for this we need to discover the available room (or we could try with a height: 100%).

ildar170975 commented 3 months ago

Tried to set a height: 100% by card-mod yesterday. About a possibility to style a card by card-mod - will report in Community a bit later.

ildar170975 commented 3 months ago

Here is a seemingly stable workaround:

type: custom:mod-card
card:
  type: custom:map-card
  x: 10
  y: 10
card_mod:
  style:
    map-card $: |
      .type-undefined {
        height: 100%;
      }
      div#map {
        height: 100% !important;
      }
    .: |
      map-card {
        height: 100% !important;
      }
      ha-card {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
      }

изображение

nathan-gs commented 3 months ago

Thanks to @Manuel-Materazzo it's fixed in v0.6.0!