lovelace-card-mod
lovelace-card-mod copied to clipboard
HA 2022.6.1 - CSS Button Icon Styles do not show anymore
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
What happened instead:
On the real dashboard, the icon is still white:
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.
Your code is not properly formatted. Use format.
The formatting got lost during the copy/paste. The code did work with 2022.5.x
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.
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?
Probably you should minimize your theme to see what part of it causes the glitch.
Thanks!
Issue still there, also with the default theme
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":