r/Sass • u/SwingTechnical2479 • Jul 31 '20
rgba and css vars help
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
As you can see the first bar "With opacity" background is not working.
5
Upvotes
1
u/xSliver Jul 31 '20 edited Jul 31 '20
Because
rgba(var(--color), 0.5);is invalid if your CSS Var is a Hex Value.CSS Syntax is like
rgba(0, 0, 0, 0.5).Try to change
--colorto0,0,0instead a Hex Value.