diff --git a/lib/src/node/value/calculation.dart b/lib/src/node/value/calculation.dart index ae3a8bd88..b51122348 100644 --- a/lib/src/node/value/calculation.dart +++ b/lib/src/node/value/calculation.dart @@ -93,7 +93,7 @@ final JSClass calculationOperationClass = () { _assertCalculationValue(left); _assertCalculationValue(right); return SassCalculation.operateInternal(operator, left, right, - inMinMax: false, simplify: false); + inLegacySassFunction: false, simplify: false); }); jsClass.defineMethods({ @@ -109,7 +109,7 @@ final JSClass calculationOperationClass = () { getJSClass(SassCalculation.operateInternal( CalculationOperator.plus, SassNumber(1), SassNumber(1), - inMinMax: false, simplify: false)) + inLegacySassFunction: false, simplify: false)) .injectSuperclass(jsClass); return jsClass; }(); diff --git a/lib/src/value/calculation.dart b/lib/src/value/calculation.dart index a5b749453..4dfd18fcc 100644 --- a/lib/src/value/calculation.dart +++ b/lib/src/value/calculation.dart @@ -506,10 +506,25 @@ class SassCalculation extends Value { case (SassNumber number, null, null): return _matchUnits(number.value.round().toDouble(), number); + case (SassNumber number, SassNumber step, null) + when (!number.hasCompatibleUnits(step)): + _verifyCompatibleNumbers([number, step]); + return SassCalculation._("round", [number, step]); + case (SassNumber number, SassNumber step, null): _verifyCompatibleNumbers([number, step]); return _roundWithStep('nearest', number, step); + case ( + SassString(text: 'nearest' || 'up' || 'down' || 'to-zero') && + var strategy, + SassNumber number, + SassNumber step + ) + when (!number.hasCompatibleUnits(step)): + _verifyCompatibleNumbers([number, step]); + return SassCalculation._("round", [strategy, number, step]); + case ( SassString(text: 'nearest' || 'up' || 'down' || 'to-zero') && var strategy,