I’m trying to achieve a circle background for icons using Button-Card but I can’t get something that stays anchored (responsively) to the button’s size and position. I know this is because I’m currently manually placing the circle as a custom_field using absolute positioning, but I’m not familiar enough with CSS grid to do it properly.
So… what’s the best way to create a circle background relative to the main icon using button-card? I’m not looking for anything fancy, just something like this:
Never use absolute positioning. My advice is: use a Mushroom card instead of a button card. You can tweak how the icon looks like by using its CSS. Sample here:
Thanks, Mushroom card is just a simple example. I actually generally need this in custom button for more complex layouts where I have “outgrown” Mushroom card hehe.
Assume we need this:
color: rgba(x,y,z,alpha)
Since theme variables are like “green”, “rgb(0,255,0)”, “#00ff00”, you need to create a function to extract these x,y,z components. This may be done inside the button-card since it supports JS.