0

I am using gulp-sass and I'm getting the following error:

Error: argument `$color` of `rgba($color, $alpha)` must be a color

When I am trying to compile the following code:

color: rgba(var(--color), 1)

What is the problem?

undefined
  • 6,366
  • 12
  • 46
  • 90
  • Possible duplicate of [Use CSS variables with rgba for gradient transparency](https://stackoverflow.com/questions/29591465/use-css-variables-with-rgba-for-gradient-transparency) – Jonathan Arbely Feb 12 '18 at 17:17

1 Answers1

-1

Try this SASS:

$r: 255
$g: 0
$b: 0
$a: 1

color: rgba($r,$g,$b,$a)

Compiles to this CSS:

color: red;

If you'd like to stick to CSS4 variables, you can find out more about handling this issue here.

Alternatively, see the answer on this related SO question.

Jonathan Arbely
  • 190
  • 2
  • 13