Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static icon color in basic cards not surviving HA restart or charging of cache. After some use of HA, the icon color works. I've tried coding the icon color in a few ways, same result. Please note, the same card-mod on mushroom cards work as expected. #378

Open
4 tasks done
cableghost opened this issue May 26, 2024 · 5 comments

Comments

@cableghost
Copy link

My Home Assistant version: 2024.5.5

My lovelace configuration method (GUI or yaml):
yaml, thru GUI

What I am doing:
Coding static icon color

What I expected to happen:
Icon color to be as I coded

What happened instead:
No color change

Minimal steps to reproduce:
Restart HA or clear cache, start fresh

type: horizontal-stack
cards:
  - show_name: true
    show_icon: true
    type: button
    icon: mdi:palette
    tap_action:
      action: toggle
    entity: script.scene_blue
    name: Blue
    card_mod:
      style: |
        ha-card {
          --paper-item-icon-color: blue;
        }
  - show_name: true
    show_icon: true
    type: button
    icon: mdi:palette
    tap_action:
      action: toggle
    entity: script.scene_green
    name: Green
    card_mod:
      style: |
        ha-card {
          --paper-item-icon-color: green;
         }
  - show_name: true
    show_icon: true
    type: button
    icon: mdi:palette
    tap_action:
      action: toggle
    entity: script.scene_orange
    name: Orange
    card_mod:
      style: |
        ha-card {
          --paper-item-icon-color: orange;
         }
  - show_name: true
    show_icon: true
    type: button
    icon: mdi:palette
    tap_action:
      action: toggle
    entity: script.scene_red
    name: Red
    card_mod:
      style: |
        ha-card {
          --paper-item-icon-color: red;
         }

Error messages from the browser console:


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.

@ildar170975
Copy link
Contributor

show_name: true
show_icon: true
type: button
icon: mdi:palette
tap_action:
  action: toggle
entity: script.test_script
name: Blue
card_mod:
  style: |
    ha-card {
      --paper-item-icon-color: blue;
     }

It is blue:

изображение

изображение

It MAY BE NOT blue in Editor since the Editor looses card-mod code (#337):

изображение

and after save it definitely NOT blue since card-mod code is deleted (i.e. not saved):

изображение

@cableghost
Copy link
Author

If the card-mod code is deleted at some point, I'm unaware, as the code is there every time I go to edit the cards. It's a strange scenario and only occurs for me inside the basic horz panel card. The same code works as expected within mushroom cards.

@ildar170975
Copy link
Contributor

If your issue is only about "card-mod code is automatically deleted" - then this is a duplicate of #337.
If not - suggest to add details since in my setup I see a color ALWAYS applied - if the card-mod code is NOT deleted.

@cableghost
Copy link
Author

cableghost commented May 29, 2024 via email

@ildar170975
Copy link
Contributor

Suggest to close the issue then since this is a duplicate of #337

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants