thomasloven / lovelace-card-mod

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

Card_mod in Entities disappears #344

Open duczz opened 6 months ago

duczz commented 6 months ago

My Home Assistant version: 2024.1.0

My lovelace configuration method (GUI or yaml): yaml

What I am doing: when i add these code snipped in an entities yaml, it is away and not be saved when i change something else in the entities, is that normal? card_mod: style: | ha-card { --ha-card-border-width: 0; --card-primary-font-weight: normal; margin-left: -13px; mushroom-shape-icon { --shape-color: none; --icon-color: #44739e; } }

What I expected to happen: i add a card_mod to remove the boarder

What happened instead: card_mod is working, but when i add a new entitie card_mod is away in the other entitie

tracklist


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

ildar170975 commented 6 months ago

seems to same as https://github.com/thomasloven/lovelace-card-mod/issues/337

duczz commented 3 months ago

Info: This problem is only when i use card_mod in a entities card

example:

entities:
  - entity: input_boolean.heizperiode
    name: Heizperiode
    icon: mdi:thermostat-box-auto
  - type: custom:mushroom-select-card
    entity: input_select.advanced_heating_control_wohnzimmer_scheduler
    name: Scheduler
    icon: mdi:calendar-month-outline
    layout: horizontal
    secondary_info: none
    card_mod:
      style: |
        ha-card {
        --ha-card-border-width: 0;
        --card-primary-font-weight: normal;
        margin-left: -13px;
        mushroom-shape-icon 
          {
          --shape-color: none;
          --icon-color: #44739e;
          }
        }
ildar170975 commented 3 months ago

Read 1 post above. Besides, your card-mod code is wrong. Suggest to ask in Community first.

duczz commented 3 months ago

Update in my post: With correct Card-mod style the same result:

    card_mod:
      style: |
        ha-card {
          --ha-card-border-width: 0;
          --card-primary-font-weight: normal;
          margin-left: -12px;
        }
        mushroom-shape-icon {
          --shape-color: none !important;
          --icon-color: #44739e !important;
        }
duczz commented 3 months ago

Update: in my case the problem is rly the entities card

i tried now many examples and always when the card_mod is inside the entities card the card_mod will be removed, outside it is considert - reproducible

when i set the card_mod to the root entities card its working, when i set it inside the entitiy it will be removed

Not working:

type: entities
entities:
  - entity: input_boolean.heizperiode
    name: Heizperiode
    icon: mdi:thermostat-box-auto
    state_color: true
  - type: custom:mushroom-select-card
    entity: input_select.advanced_heating_control_wohnzimmer_scheduler
    name: Scheduler
    icon: mdi:calendar-month-outline
    layout: horizontal
    secondary_info: none
    card_mod:
      style: |
        ha-card {
          --ha-card-border-width: 0;
          --card-primary-font-weight: normal;
          margin-left: -12px;
        }
        mushroom-shape-icon {
          --shape-color: none !important;
          --icon-color: #44739e !important;
        }

working (code will not be removed, when i remove a entitiy via UI)

type: entities
entities:
  - entity: input_boolean.heizperiode
    name: Heizperiode
    icon: mdi:thermostat-box-auto
    state_color: true
  - type: custom:mushroom-select-card
    entity: input_select.advanced_heating_control_wohnzimmer_scheduler
    name: Scheduler
    icon: mdi:calendar-month-outline
    layout: horizontal
    secondary_info: none
card_mod:
  style: |
    ha-card {
      --ha-card-border-width: 0;
      --card-primary-font-weight: normal;
      margin-left: -12px;
    }
    mushroom-shape-icon {
      --shape-color: none !important;
      --icon-color: #44739e !important;
    }
ildar170975 commented 3 months ago

Very persistent man. Two time you were told that the issue was already registered and yet you keep posting here.

duczz commented 3 months ago

yep, you said, and it looks like. My oppinion is a different one.