Here is a pen of what I am trying to achieve .
I am trying to load css var from js. it works great with the one exception the rgba () function
this.window.document.querySelector(':root').style.setProperty('--color', '#000');
This works
.no-opacity{
color: white;
background: var(--color)
}
This does not
background: rgba(var(--color), 0.5);
In the pen I made it as a mixin but the results are the same.
As you can see the first bar "With opacity" background is not working. I am loading the css variable using css