thomasloven / lovelace-card-mod

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

Card mod styled buttons not consistently working #328

Closed robertboccia closed 6 months ago

robertboccia commented 6 months ago

My Home Assistant version: 2023.12.4

My lovelace configuration method (GUI or yaml): yaml

What I am doing: buttons styled with card mod with colours

What I expected to happen: buttons displayed with colour

What happened instead: buttons displayed in grey (no colour)

Minimal steps to reproduce:

# The least amount of code possible to reproduce my error
card_mod: 
style: |
    ha-card {
         --ha-card-background: rgb(30,30,40);
         --card-mod-icon-color: red
      }
# End of code

Error messages from the browser console:


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

robertboccia commented 6 months ago

This is what it should look like

Screenshot_20231228_074955_Home Assistant.jpg

This is what's happening

Screenshot_20231228_074943_Chrome.jpg

pergolafabio commented 6 months ago

I believe I see the same issue now when updating from 3.3.0 to 3.4.0, all my transparant colors are gone, everything is now grey background

pergolafabio commented 6 months ago

What did you do to fix?

SmarterHomeLife commented 6 months ago

Hi @robertboccia I'm keen to know what you did to fix this as well?

pergolafabio commented 6 months ago

for me this doesnt work anymore, transparant, my markdown cards now do have a background instead of transparant:

  style: |
    ha-card {
      box-shadow: none;
      height: 33px;
      background-color: transparent;
      padding: 0px 10px;
      color: var(--header-color);
m1ke-hub commented 6 months ago

Sometimes, I have to reload the page for the mods to be applied. This only started with 3.4.0 - maybe try to reload the page and see if the mods are applied. Definitely not a long-term solution, but let's see if you guys have the same problem as me.

Edit: see https://github.com/thomasloven/lovelace-card-mod/issues/329