thomasloven / lovelace-card-mod

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

Card-Mod works very slowly. Style overrides are visible #400

Open kosmaluk opened 3 weeks ago

kosmaluk commented 3 weeks ago

My Home Assistant version: 2024.8.2 HAOS 12.3 Dell Optiplex 8GB RAM Disc 256MB

My lovelace configuration method (GUI or yaml): GUI

I'm using card-mod 3.4.3. I have it installed as a resource and as an extra_module. For some time now, you can see with the naked eye how code changes saved in the card_modu style are being loaded. The styles are changed in each card separately. I don't use themes. The card style change is very slow and visible. There is a slight improvement after saving cookies, but it is still visible

What I am doing:

I uninstalled and reinstalled card_mod, cleared caches in both Chrome and the companion app on Android, and nothing changes. Also after adding extra_module in configuration.yaml. There is still a delay

What I expected to happen:

Previously, the operation of card-mod was immediate, almost imperceptible to the eye and certainly not so slow. He would expect the card style to change quickly and unnoticeably

What happened instead:

Minimal steps to reproduce:

# The least amount of code possible to reproduce my error

        type: custom:mushroom-title-card
        title: __________  STEROWANIE  ___________
        subtitle: ''
        card_mod:
          style: |
            ha-card {
               --title-font-size: 1.0rem;
               --title-spacing: 0rem;
               --title-padding: 0.5rem;
               --title-color: grey;
               --title-line-height: 12px;
               text-align: center;
               border: none;
               box-shadow: none;
               background: rgba(0,0,0,0);
               margin-top: 0rem;
               margin-bottom: 0rem;
            }
# End of code

Error messages from the browser console: The system does not show any errors

https://github.com/user-attachments/assets/c8b2d64f-d787-4249-96ac-6c2920852dfb

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

Socio241 commented 2 weeks ago

Same for me. I have reduced some top- and bottom-margins in a theme to get everything fitted on my tablet screen. With card-mod 3.4.3 everytime the screen turns on I can see the contents of the dashboard being shifted down and up again once the margins are applied. After reverting to 3.4.0 it works much better, most of the time no shifting is visible at all.

rubin110 commented 5 days ago

Most likely related to or the same as #354 and #359.