lovelace-card-mod: Card-Mod works very slowly. Style overrides are visible

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:

  • [] Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

  • [] Have made sure I am using the latest version of the plugin.

  • [] Have followed the troubleshooting steps of the “Common Problems” section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

  • [] Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 20 (4 by maintainers)

Most upvoted comments

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.