how to pass color rgb
inside rgba
to decrease opacity?
:root {
--bg: rgb(84, 15, 84);
}
p {
background-color: var(--bg);
color: #fff;
}
<p>
hello world
</p>
I want to pass the --bg
variable inside rgba
so I can decrease the opacity without touching touching the --bg
variable.
I have tried:
background-color: rgba( var(--bg), 0.4 );
but it doesn't work. Can anyone help?