calc() inside rgb() is causing the value to be stripped out
Tabrisrp opened this issue · comments
When using calc()
inside a rgb()
value, after parsing the corresponding property is getting stripped out completely from the tokens.
An example:
.dark{
background: var(--dark);
--red: 37;
--green: 211;
--blue: 102;
--dark:rgb( calc( var(--red) - 75),calc( var(--green) - 75),calc( var(--blue) - 75));
}
Gives the following output after parsing:
[
{
"tokens": [
[
{
".dark": {
"1": [
"dark"
]
}
},
[
"background:var(--dark)",
"--red:37",
"--green:211",
"--blue:102"
]
]
]
}
]
As you can see, the --dark:rgb( calc( var(--red) - 75),calc( var(--green) - 75),calc( var(--blue) - 75));
is removed.
We isolated this to the calc()
by using different values for rgb, like using only the variables, or using hardcoded values directly. In both cases, the output was correct.
This may be a duplicate of #257 which may be fixed in master
.
I didn't state this in the OP, but testing of this issue was done with the master
branch.