postcss / postcss-calc

PostCSS plugin to reduce calc()
MIT License
215 stars 33 forks source link

3-level deep var()s inside a calc() throw an error #119

Closed maranomynet closed 1 year ago

maranomynet commented 4 years ago

This valid CSS code:

body {
  width: calc( var(--a, var(--b, var(--c))) + 10px );
}

Triggers this error in postcss-calc@7.0.4:

Stack:
JisonParserError: Parse error on line 1: 
var(--a, var(--b, var(--c))) + 10px
---------------------------^
Expecting end of input, "ADD", "SUB", "MUL", "DIV", got unexpected "RPAREN"

Whereas this gets parsed correctly:

body {
  width: calc( var(--a, var(--b)) + 10px );
}
alexander-akait commented 4 years ago

PR welcome

ludofischer commented 2 years ago

Still throws a warning even though it does not crash in 8.2

maranomynet commented 1 year ago

This is reported and being discussed in #104