piitaya / lovelace-mushroom

Build a beautiful Home Assistant dashboard easily
Apache License 2.0
3.7k stars 340 forks source link

[Feature]: Add fields content_color and background_color to template chip card #604

Open luixal opened 2 years ago

luixal commented 2 years ago

Is your feature request related to a problem?

I tend to use colors according to sensor's state values. For example: in a battery sensor, above 50% is green, 20-50% is orange and below 20% is red. Also, with a custom icon for each range too.

When trying to follow this using the template chip card, I face two problems: no support for content color and no support for background color (chips are small, it feels better to play with its background color too). This is related to #445 .

Describe the solution you'd like

Add two fields to template chip card: content_color and background_color (or just background) that support templates.

Describe alternatives you've considered

I tried using custom styling on the chips card but feels too hack-ish.

Additional context

No response

piitaya commented 2 years ago

It is not a priority for now to update the chips design. For design consistency. I don't think it's a good idea to allow text, background and icon color. Only one color must be allowed to simplify the config.

luixal commented 2 years ago

I still think chips are a special case and would be great to be able to achieve something like this (from Chips - Material Design):

image

Would you consider merging a PR for supporting this or do you prefer to keep this as is? Not sure but maybe I could give a hand here.

Thanks!

jamesonuk commented 1 year ago

Came looking for the same. My use case if that I want to highlight where temperature or humidity are outside of my desired range. I have the icons coloured conditionally and it works OK but it would be mush easier to identify issues if I was able to change the background colour to make the chips stand out.