custom-cards / decluttering-card

🧹 Declutter your lovelace configuration with the help of this card
MIT License
379 stars 29 forks source link

layout-card mediaquery doesn't work when contained in a decluttering-card #46

Open MadMaxMcKinney opened 3 years ago

MadMaxMcKinney commented 3 years ago

So I've got a simple grid from layout_card:

base_myhomekit_card_grid:

  # Detault vars ####
  default:
    - cards: ""

  card:
    type: custom:layout-card
    layout_type: grid
    layout_options:
      grid-template-columns: 1fr 1fr 1fr 1fr 1fr
      grid-template-rows: auto
      grid-gap: 8px
      mediaquery:
      "(max-width: 650px)":
        grid-template-columns: 1fr 1fr 1fr
    cards: '[[cards]]'

However, the mediaquery doesn't work for some reason. If I use the layout-card on its own and not as a template for the decluttering-card everything works as it should.

What's going on here?

Reference for layout-card

fbsdmon commented 10 months ago

Fixing this would make my life a lot easier

ildar170975 commented 10 months ago

The code in the 1st post is wrongly indented:

      mediaquery:
      "(max-width: 650px)":
        grid-template-columns: 1fr 1fr 1fr

So it is not supposed to work properly. The fixed code works OK as a decluttering template. No issue here, just a wrong use.