thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.04k stars 169 forks source link

Position: Sticky not working in mobile app #379

Closed UberDudePL closed 3 weeks ago

UberDudePL commented 3 weeks ago

My Home Assistant version: 2024.6.2

My lovelace configuration method (GUI or yaml): yaml

What I am doing: Adding a footer as posistion: sticky to have it float in my dashboard

What I expected to happen: Footer is floating image

What happened instead: PC it is working fine, in mobile app it does not WhatsApp Image 2024-06-12 at 19 33 10_938b97b9

Minimal steps to reproduce:

card_mod:
  style: |
    :host {
      position: sticky !important;
      bottom: 26px;
      margin-bottom: 10px !important;
      animation: 1.2s position ease-in-out;
    }
    @keyframes position {
      0% { bottom: -80px; }
      20% { bottom: -80px; }
      70% { bottom: 26px; }
      90% { bottom: 24px; }
      100% { bottom: 26px; }
    }
    ha-card { 
      background: none;
      border-radius: 26px !important;
    }
    :host:before {
      content: '';
      display: block;
      position: absolute;
      bottom: -26px;
      left: -8px;
      padding-right: 16px;
      height: 130px;
      width: 100%; 
      background: linear-gradient(180deg, rgba(45, 56, 76, 0) 0%, rgba(35, 46, 66, 0.85) 50%);
      pointer-events: none;
      animation: 1.2s opacity ease-in-out;
    }
    @keyframes opacity {
      0% { opacity: 0; }
      20% { opacity: 0; }
      100% { opacity: 1; }
    }

Error messages from the browser console:


By putting an X in the boxes ([]) below, I indicate that I:

UberDudePL commented 3 weeks ago

When I reverted back to 2024.5.X, it stared to work correctly. I've updated test VM to 2024.6.2 and it stopped working

ildar170975 commented 3 weeks ago
  1. Post a properly formatted code. Use triple "`".
  2. Guess this is more a question than a bug and thus should be posted in Community instead.
UberDudePL commented 3 weeks ago

Apologies, corrected the code.

UberDudePL commented 3 weeks ago

I didn't do anything with HA but sticky position stopped working on PC as well. It is at the bottom of dashboard

ildar170975 commented 3 weeks ago

2024.6 does have some changes. But this is most probably not a "card-mod bug" - you just need to ADAPT your code. Suggest to close the issue & ask in Community. And when asking in Community - do not forget to add some more details: you posted a card-mod code but missed a card to which you wish to apply this code.

Seems I already gave some suggestions here: https://community.home-assistant.io/t/broken-configuration-after-core-2024-6-0/738530/4?u=ildar_gabdullin

UberDudePL commented 3 weeks ago

I will close it, looks like there is someelse with the same problem but they did not create reply in community of card_mod. I just did