Sub Button Icon State Color #1037
-
Today we can color the background when the entity is considered
For my purposes, a singular toggle for I have tried to accomplish this via style to color my phone battery icon but instead it's coloring based on the main person entity. I am not well versed in CSS nor JS so it's perhaps possible this way and I just do not yet know it. type: custom:bubble-card
card_type: button
button_type: state
show_attribute: false
sub_button:
- entity: sensor.phone_battery_level
show_background: false
show_attribute: false
show_state: true
show_state: false
styles: |-
.bubble-sub-button-1 {
color: var(--state-icon-color) !important;
}
entity: person.me This is effectively the type: heading
icon: ""
heading_style: title
badges:
- type: entity
show_state: true
show_icon: true
entity: sensor.phone_battery_level
color: state Now that I'm comparing the two, I think copying the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Paste following in your custom style:
If this solves your question, mark it as solved and close the discussion. |
Beta Was this translation helpful? Give feedback.
Thank you @MrBearPresident for all your help! By editing your solution I was able to create exactly what I wanted (though would be preferable if state colors were built in and matched Home Assistant's built in cards exactly so I'll make FR as you suggested).
Turns out I can use the CSS vars from home assistant's implantation and copy their thresholds!
Below I used your logic and copied the CSS vars and thresholds from the native cards as shown in the file you found. https://github.com/home-assistant/frontend/blob/3fd3c8003a0a1deb18d8959f94ca2dc7b1bfb63d/src/common/entity/color/battery_color.ts