MelleD / lovelace-expander-card

Expander card for HomeAssistant
Apache License 2.0
23 stars 4 forks source link

Change Title Background Color when expanded #148

Closed duczz closed 3 weeks ago

duczz commented 3 weeks ago

when you use multiple expander cards its hard to see which one is currently expanded, it would be great when the activ expanded expander card header has a other color.

so is it possible to add a function thats allow to change the title background color from the expanded card? (only when expanded)

image

MelleD commented 3 weeks ago

@duczz open

Bildschirmfoto 2024-06-15 um 09 39 33

        type: custom:expander-card
        title: "Räume"
        expander-card-background-expanded: "#ffffff12 radial-gradient(circle, transparent 1%, #ffffff12 1%)"```
duczz commented 3 weeks ago

Perfect, looks good 👍🏻👍🏻 Is it possible to Change the color only from the top Line (Räume ) too? Currentlly it looks like it change the General backgroundcolor without the entities

MelleD commented 3 weeks ago

Yes only the complete background. The other option for the button looked weired when you have padding. But if you see the PR you could also easily add a option for button background expanded.

IMHO this make more sense because you can the group which is related to the expander make also sense when you have more than one

duczz commented 3 weeks ago

Alright thank you 👍🏻

MelleD commented 3 weeks ago

What I would like to try is to make the state open/closed into a var. Maybe then you can do everything what you want with card mod if you have the state —var(open)

But I have no experience to expose variables to card mod and have to test it when I have some time ;)

duczz commented 3 weeks ago

That would be cool, that makes it much more flexible 👍🏻