I'm trying to change the opacity of a color stored in a variable.
:root { --main-theme-color: rgb(123, 40, 231); } .box{ background-color: rgba(var(--message-box-transparency),0.5); }
I tried setting it to rgba to change the opacity of the color in the variable but it didn't work, is there any other way to change the opacity of the color in the variable.
You can use custom attributes to achieve this function