Closed ktownsend-personal closed 3 years ago
Did you try with type: custom:hui-vertical-stack-card
?
I was not aware of that name syntax to reference the vertical stack card. I will have to try it and see. Interestingly, I seem to have completely forgotten what I was trying to do when I asked this question. I'll have to remember to put more context for myself the next time 🙂
I finally got a chance to try out your suggestion, and it works perfectly, I'm going to make a note of that technique. Thanks!
Is your feature request related to a problem? Please describe. I have a need for a
vertical-stack
inside apicture-elements
card, but unfortunatelypicture-elements
card can't use native elements directly. As a possible solution I tried to use your stack-in-card. The problem is that I can't style the background-color appropriately. I'm attempting to usergba(0,0,0,0.4)
in thestyle
property thatpicture-elements
uses for child elements, but that only applies to the outer element of your card and you have an inner element inside a shadow root that is forcing the background color to be--card-background-color
(ha-card.type-custom-stack-in-card
). In my case, I need that to betransparent
so that the styles applied by thepicture-elements
card on the parent element can be effective.I don't need any of the features of your
stack-in-card
, so maybe there is a better way to use native cards in thepicture-elements
card. Ideally thepicture-elements
card would get updated someday to allow native cards directly, but a next-best option would be a simple custom wrapper card that can contain a native or custom card. My 2nd workaround below is based on that idea and works well, but it seems heavier than necessary to use acustom:button-card
in that way. I'm interested to know if you happen to be aware of a simpler custom card to wrap a native card.Describe the solution you'd like The styles config feature you have in your custom button card seems like a reasonable way to expose styling for the elements in the shadow root. Another option would be making the
background-color
ofha-card.type-custom-stack-in-card
transparent by default so that background styling applied to the outer element can be effective.Describe alternatives you've considered There are 2 workarounds that I found:
card-mod
to reach into the shadow root and setbackground-color:transparent
onha-card.type-custom-stack-in-card
custom:button-card
as a container for the native vertical-stack so that I can control the styles more easily (instead of usingstack-in-card
at all)Additional context I'm currently using the 2nd workaround because I already have a "container" template for the
custom:button-card
.