@RomRider Right. If you style inside the state, it ignores styles outside of the state. So yes, styles inside the state should add to styles outside, and override if there is a conflict.
Also want to say, you have made this button one of the most important elements in Lovelace. Iām looking forward to seeing how people create innovative panels with this button.
Off-topic, (but Iād like to know from people using this button) does anyone use Layout Card or something else to establish card order?
@RomRider is there a way to have the buttons centered ?
If I donāt mentioned the width on the last button it gets very wide as you see on the green button.
I try to have uniform buttons.
@RomRider - do you have on your āto-doā list the ability to individually customise text, icon, and card colour depending on either the card entity state or another specified entity by any chance please? I canāt see any reference to this in the GitHub readme or open issues, so happy to create a new one for tracking if you like?
Thanks.
Templating feature is very cool! Iāve combined a battery state sensor and battery level sensor into one card within the first few minutes of trying it. Also made a āNow Playingā for Spotify (media_title and media_artist attributes):
It would be perfect if you could style the label too though. Like in this example Iād like the label with now playing text to be a smaller font size and different color. Maybe something that could be considered?
for now style and entity_picture_style are still supported, but please make sure you update your configuration so that style becomes card and entity_picture_style becomes entity_picture, both under the styles option (note the S at the end of styles). Next releases will drop the support for style and entity_picture_style.
Basically, this:
The styles defined in each state are now additive with the styles defined in the main part of the configuration. It means you donāt have to define all the CSS entries in each state, only define the ones which change. Define the common ones in the main styles config part and define specific ones in each statestyles entries.
New Features
Styling per element supported by using the new styles object available in the main config and in each state entry.
You can configure the style for:
card: Styles that are defined here will be applied to the whole card and itās content, unless redefined in elements below.
Great work, I like what you have done with styles as it will save a lot of code. However do I need to change something to get the right RGB brightness colors? It says it is fixed in the last PR, however I still get a difference in brightness.
Screenshots below, show brightness at around 20%, they are the same entity (different icon srry). The button screenshot shows the color with this card, the screenshot with the lightbulb shows the original HA color (brightness is at 20%)
Did you empty your browser cache? Try in a private instance of your browser please to make sure it has nothing to do with caching.
If itās still not working copy the content of your light state when itās at 20% like in the picture (using the http://HASS_IP/dev-state)
I donāt have the issue anymore (brightness ~= 25%):
Hm yeah in my browser it has the right color, canāt seem to clear cache in the ios app (usually a refresh would suffice, but seems to do nothing). Will try some more refreshes haha. Thanks anyways.
Edit: Couldnāt get it to clear, reinstalling the ios app solved it for me.
This is truly amazing! I was literally trying to figure out whether I could style an individual button based on an entity state last night. So glad I decided to sleep on it and not forge ahead. Thank you so much @RomRider!
Quick question for the brain trust - Does anyone know how I might go about tweaking the gap between these cards? I tried using -padding: 0px but that didnāt have my desired effect.
Ultimately, my goal is to make these buttons look and function more like a tabbed sub-menu system whereby each button triggers a conditional card based on the state of several input_booleans within the same view.