button-card icon indicating copy to clipboard operation
button-card copied to clipboard

Opacity and Background Color

Open broyuken opened this issue 3 years ago • 2 comments

I'm trying to get the background color of the selected menu item on the left side of the main HA interface to use in a label card but I can't figure it out. HA seems to use the following to color it.

background-color: var(--sidebar-selected-icon-color);
opacity: 0.12;

How can I set the opacity of just the background without changing the text as well? I believe I can use the rgba, but I don't think I can use that in conjunction with the variable.

Thanks in advance!

broyuken avatar Oct 30 '22 02:10 broyuken

bueller?

broyuken avatar Nov 08 '22 01:11 broyuken

You can do that in supported browser: background-color: color-mix(in srgb, var(--sidebar-selected-icon-color) 50%, transparent) (50% is the transparency here)

RomRider avatar Jul 26 '23 16:07 RomRider