lovelace-card-mod icon indicating copy to clipboard operation
lovelace-card-mod copied to clipboard

HA 2022.6.1 - CSS Button Icon Styles do not show anymore

Open esjani opened this issue 2 years ago • 8 comments

My Home Assistant version: 2022.6.1

My lovelace configuration method (GUI or yaml): yaml

What I am doing:

Custom button styles:

type: custom:mini-graph-card icon: mdi:pool entities:

  • sensor.tas_pool_ds18b20_temperature name: Pool tap_action: action: call-service service: homeassistant.toggle service_data: entity_id: switch.tas_pool hours_to_show: 168 points_per_hour: 0.25 line_color: orange decimals: 1 card_mod: style: | :host { --card-mod-icon-color: {% set e = states('switch.tas_pool') %} {% if (e == 'on') %} orange {% elif (e == 'off') %} white {% endif %} }

What I expected to happen:

In the editor preview everything is working 30EC56F3-ADFC-4326-886F-3FFA901C51D2

What happened instead:

On the real dashboard, the icon is still white:

ACF67D6D-65B0-45E4-A16D-20DBAF392CB9

Multiple Browsers: ios 15.1 safari and Fully Browser on a FireHD, same results. Home Assitant 2022.5.x worked fine.

Error messages from the browser console:


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

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

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

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

  • [x] 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.

esjani avatar Jun 03 '22 15:06 esjani

Your code is not properly formatted. Use format.

ildar170975 avatar Jun 03 '22 15:06 ildar170975

The formatting got lost during the copy/paste. The code did work with 2022.5.x

56A9099C-45CC-40C8-8D8C-9094E7653C47

esjani avatar Jun 03 '22 16:06 esjani

The code is placed between triple "`" to be properly formatted.

Seems you are using a custom theme. Do you use a card-mod theme in your custom theme? Did you check the "--card-mod-icon-color" inside Entities card? Check this.

ildar170975 avatar Jun 03 '22 16:06 ildar170975

Thanks, I do use a custom theme and that seemed to be the problem - if I remove it, everything works!

How can I fix this with the custom theme?

esjani avatar Jun 03 '22 16:06 esjani

Probably you should minimize your theme to see what part of it causes the glitch.

ildar170975 avatar Jun 03 '22 17:06 ildar170975

Thanks!

esjani avatar Jun 03 '22 17:06 esjani

Issue still there, also with the default theme

esjani avatar Jun 13 '22 14:06 esjani

With a default theme this code works: изображение

With a custom card-mod-theme: a) when in "edit mode": изображение

b) when in "normal mode": изображение

c) when in "Edit window": изображение

ildar170975 avatar Jun 13 '22 14:06 ildar170975