Created by: ysds
Fixes #28792 (closed)
Add the two Sass functions (add(), subtract()) to return a valid calc. These functions basically return a calc expression, but if one value is 0 the functions return another value.
e.g.
div {
padding: add(1rem, 1px); // calc(1rem + 1px)
padding: add(1rem, 0); // 1rem
}
The each functions has the third argument (boolean). If true, the expression is returned with wrapped by calc, but if false, the expression is not wrapped with calc. The default is true. This option is intended for use in complex nested expressions:
e.g.
div {
padding: add(1rem, add(1em, 1px)); // calc(1rem + calc(1em + 1px)) : invalid in IE
padding: add(1rem, add(1em, 1px, false)); // calc(1rem + 1em + 1px) : valid in IE
}
-
add calc() to stylelint function-blacklist