Please see my code inspector screenshot below after I added class_0 to my stack-in-card code. I am still struggling to figure out the path based on what I see in code inspector. If I’m wrong again, maybe you could give me some hints that could help me do the correct path based on my screenshot (to know what to look for).
Starting this night I am far away from any civilian PC for at least a week, so can only suggest:
1st post → link at the bottom → other stuff → hints about navigating
There you will find info how to define a path.
You need to understand it.
And once again: my example with classes is exactly about headers; since you need to style “stack-in-card” only - you do not need invent new classes like “class_2” etc, address to “.type-custom-stack-in-card”.
Check examples of Thomas in ReadMe for styling classes; this is for understanding that this method only works for non-shadowRoot elements. But you need to access shadowRoot element “.card-header”. So use a trick with defining variables on a non-shadowRoot level - and then using this variable on the shadowRoot level.
Hi аnd thanks again for the response. I was using the below configuration but it wasn’t giving me the desired result, I can’t explain why. Could it be a not cleared cache issue, although I’m pretty sure that I had cleared it multiple times and used both browsers, Chrome and Firefox. It’s really strange. Now it works. Благодарю.
Compare what I have posted with that you have tried. Until you are not doing, what I suggest, it will ofc not work. In my code is another card-mod on top level and not on entity level. And I have explained the reason for that, too.
This mod-card it is a specific lovelace card? I should install it from hacs or something?
Edit: I see there is a ha-card element but not of the grid card.
About the mod-card, now I found out what is this my bad… But how can I achieve what I want?
Wondering if anyone had some advice for my post here. Really scratching my head on this one.
All of the styling on this 2nd screenshot is exactly the same as my original post (I have added one entity marked by the light bulb mdi). I’m finding when I restart home assistant, the card uses the red color I have defined when cycling sensors and entities on the card.
It only does this on restart. As soon as Home Assistant has fully restarted, it reverts to the default yellow.
Does anyone have any good resources to learn CSS styles/CardMod in general?
What happens if you open the browser dev tools and disable the cache?
You might be suffering of this:
NOTE 2: Following on the note above; due to the high level of load order optimization used in Home Assistant, it is not guaranteed that the #shadow-root or the mwc-buttonactually exists at the point in time when card-mod is looking for it. If you use the second method above, card-mod will be able to retry looking for #shadow-root at a later point, which may lead to more stable operation.
In short; if things seem to be working intermittently - try splitting up the chain.
But I can´t get the iframe background transparent or the title of this HA website Card to be centered.
Background is displayed white and Title is shown left
Hey there!
I tried many approaches to reach the code below as clean as possible, but this was the best that I could. Do you guys can tell me how do do it better ?