diff --git a/spec/values/calculation/abs.hrx b/spec/values/calculation/abs.hrx index 4688f42c5..1cdd8987d 100644 --- a/spec/values/calculation/abs.hrx +++ b/spec/values/calculation/abs.hrx @@ -14,36 +14,34 @@ a { <===> ================================================================================ -<===> positive/integer/input.scss +<===> positive/input.scss a {b: abs(1)} -<===> positive/integer/output.css +<===> positive/output.css a { b: 1; } <===> ================================================================================ -<===> negative/decimal/input.scss -a {b: abs(-5.6px)} +<===> negative/input.scss +a {b: abs(-5.6)} -<===> negative/decimal/output.css +<===> negative/output.css a { - b: 5.6px; + b: 5.6; } <===> ================================================================================ -<===> operation/variable/input.scss +<===> operation/simplification/input.scss a { - --test: 5; - b: abs(1px + 2px - var(--test)) + b: abs(1px + 2px - var(--c)) } -<===> operation/variable/output.css +<===> operation/simplification/output.css a { - --test: 5; - b: abs(3px - var(--test)); + b: abs(3px - var(--c)); } <===> @@ -56,41 +54,6 @@ a { b: 1.75px; } -<===> -================================================================================ -<===> operation/incompatible_units/input.scss -a {b: abs(17px * 5%)} - -<===> operation/incompatible_units/error -Error: 85px*% isn't a valid CSS value. - , -1 | a {b: abs(17px * 5%)} - | ^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> operation/integer/input.scss -a {b: abs(17 * 5%)} - -<===> operation/integer/output.css -a { - b: 85%; -} - -<===> operation/integer/warning -DEPRECATION WARNING: Passing percentage units to the global abs() function is deprecated. -In the future, this will emit a CSS abs() function to be resolved by the browser. -To preserve current behavior: math.abs(85%) -To emit a CSS abs() now: abs(#{85%}) -More info: https://sass-lang.com/d/abs-percent - , -1 | a {b: abs(17 * 5%)} - | ^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:1 root stylesheet - <===> ================================================================================ <===> preserved/operation/percentage/input.scss @@ -105,26 +68,12 @@ a { ================================================================================ <===> preserved/variable/input.scss a { - --test: 5; - b: abs(var(--test)) + b: abs(var(--c)) } <===> preserved/variable/output.css a { - --test: 5; - b: abs(var(--test)); -} - -<===> -================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: abs(test); -} - -<===> preserved/unquoted_string/output.css -a { - b: abs(test); + b: abs(var(--c)); } <===> @@ -183,16 +132,16 @@ More info and automated migrator: https://sass-lang.com/d/slash-div <===> ================================================================================ -<===> error/incompatible_units/input.scss -a {b: abs(17px + 4deg)} +<===> error/named_argument/variable/input.scss +a {b: abs($number: var(--c))} -<===> error/incompatible_units/error -Error: 17px and 4deg are incompatible. +<===> error/named_argument/variable/error +Error: $number: var(--c) is not a number. , -1 | a {b: abs(17px + 4deg)} - | ^^^^^^^^^^^ +1 | a {b: abs($number: var(--c))} + | ^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:11 root stylesheet + input.scss 1:7 root stylesheet <===> ================================================================================ diff --git a/spec/values/calculation/acos.hrx b/spec/values/calculation/acos.hrx index 888ef9b8b..b42821f76 100644 --- a/spec/values/calculation/acos.hrx +++ b/spec/values/calculation/acos.hrx @@ -14,22 +14,32 @@ a { <===> ================================================================================ -<===> negative_decimal/input.scss -a {b: acos(-0.5)} +<===> negative_one/input.scss +a {b: acos(-1)} -<===> negative_decimal/output.css +<===> negative_one/output.css a { - b: 120deg; + b: 180deg; } <===> ================================================================================ -<===> decimal/input.scss -a {b: acos(0.5)} +<===> zero/input.scss +a {b: acos(0)} -<===> decimal/output.css +<===> zero/output.css a { - b: 60deg; + b: 90deg; +} + +<===> +================================================================================ +<===> zero_fuzzy/input.scss +a {b: acos(0.000000000001)} + +<===> zero_fuzzy/output.css +a { + b: 89.9999999999deg; } <===> @@ -64,52 +74,36 @@ a { <===> ================================================================================ -<===> preserved/percent/input.scss -a {b: acos(3px - 1.5px + 5%)} - -<===> preserved/percent/output.css -a { - b: acos(1.5px + 5%); -} - -<===> -================================================================================ -<===> preserved/operation/variable/input.scss +<===> operation/simplification/input.scss a { - --test: 5; - b: acos(3px - 1px + var(--test)); + b: acos(3px - 1px + var(--c)); } -<===> preserved/operation/variable/output.css +<===> operation/simplification/output.css a { - --test: 5; - b: acos(2px + var(--test)); + b: acos(2px + var(--c)); } <===> ================================================================================ <===> preserved/variable/input.scss a { - --test: 5; - b: acos(var(--test)); + b: acos(var(--c)); } <===> preserved/variable/output.css a { - --test: 5; - b: acos(var(--test)); + b: acos(var(--c)); } <===> ================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: acos(test); -} +<===> preserved/operation/percentage/input.scss +a {b: acos(17px + 5%)} -<===> preserved/unquoted_string/output.css +<===> preserved/operation/percentage/output.css a { - b: acos(test); + b: acos(17px + 5%); } <===> @@ -125,19 +119,6 @@ Error: Expected 1px to have no units. ' input.scss 1:7 root stylesheet -<===> -================================================================================ -<===> error/percent/input.scss -a {b: acos(1%)} - -<===> error/percent/error -Error: Expected 1% to have no units. - , -1 | a {b: acos(1%)} - | ^^^^^^^^ - ' - input.scss 1:7 root stylesheet - <===> ================================================================================ <===> error/type/input.scss @@ -189,3 +170,16 @@ Error: Expected identifier. | ^ ' input.scss 1:13 root stylesheet + +<===> +================================================================================ +<===> error/named_argument/input.scss +a {b: acos($number: 3)} + +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: acos($number: 3)} + | ^ + ' + input.scss 1:19 root stylesheet diff --git a/spec/values/calculation/asin.hrx b/spec/values/calculation/asin.hrx index 2b384dcb9..8871e8060 100644 --- a/spec/values/calculation/asin.hrx +++ b/spec/values/calculation/asin.hrx @@ -14,32 +14,12 @@ a { <===> ================================================================================ -<===> negative_decimal/input.scss -a {b: asin(-0.5)} +<===> negative_one/input.scss +a {b: asin(-1)} -<===> negative_decimal/output.css +<===> negative_one/output.css a { - b: -30deg; -} - -<===> -================================================================================ -<===> negative_zero/input.scss -a {b: asin(-0.0)} - -<===> negative_zero/output.css -a { - b: 0deg; -} - -<===> -================================================================================ -<===> negative_zero_fuzzy/input.scss -a {b: asin(-0.000000000001)} - -<===> negative_zero_fuzzy/output.css -a { - b: -0.0000000001deg; + b: -90deg; } <===> @@ -62,16 +42,6 @@ a { b: 0.0000000001deg; } -<===> -================================================================================ -<===> decimal/input.scss -a {b: asin(0.5)} - -<===> decimal/output.css -a { - b: 30deg; -} - <===> ================================================================================ <===> one/input.scss @@ -104,52 +74,36 @@ a { <===> ================================================================================ -<===> preserved/percent/input.scss -a {b: asin(3px - 1.5px + 5%)} - -<===> preserved/percent/output.css +<===> operation/simplification/input.scss a { - b: asin(1.5px + 5%); + b: asin(3px - 1px + var(--c)); } -<===> -================================================================================ -<===> preserved/operation/variable/input.scss -a { - --test: 5; - b: asin(3px - 1px + var(--test)); -} - -<===> preserved/operation/variable/output.css +<===> operation/simplification/output.css a { - --test: 5; - b: asin(2px + var(--test)); + b: asin(2px + var(--c)); } <===> ================================================================================ <===> preserved/variable/input.scss a { - --test: 5; - b: asin(var(--test)); + b: asin(var(--c)); } <===> preserved/variable/output.css a { - --test: 5; - b: asin(var(--test)); + b: asin(var(--c)); } <===> ================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: asin(test); -} +<===> preserved/operation/percentage/input.scss +a {b: asin(3px - 1.5px + 5%)} -<===> preserved/unquoted_string/output.css +<===> preserved/operation/percentage/output.css a { - b: asin(test); + b: asin(1.5px + 5%); } <===> @@ -165,19 +119,6 @@ Error: Expected 1px to have no units. ' input.scss 1:7 root stylesheet -<===> -================================================================================ -<===> error/percent/input.scss -a {b: asin(1%)} - -<===> error/percent/error -Error: Expected 1% to have no units. - , -1 | a {b: asin(1%)} - | ^^^^^^^^ - ' - input.scss 1:7 root stylesheet - <===> ================================================================================ <===> error/type/input.scss @@ -229,3 +170,16 @@ Error: Expected identifier. | ^ ' input.scss 1:13 root stylesheet + +<===> +================================================================================ +<===> error/named_argument/input.scss +a {b: asin($number: 3)} + +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: asin($number: 3)} + | ^ + ' + input.scss 1:19 root stylesheet diff --git a/spec/values/calculation/atan.hrx b/spec/values/calculation/atan.hrx index 3d7b97011..b73ee9499 100644 --- a/spec/values/calculation/atan.hrx +++ b/spec/values/calculation/atan.hrx @@ -15,32 +15,23 @@ a { <===> ================================================================================ -<===> negative/input.scss -a {b: atan(-1)} - -<===> negative/output.css -a { - b: -45deg; -} - -<===> -================================================================================ -<===> negative_zero/input.scss -a {b: atan(-0.0)} +<===> less_than_negative_one/input.scss +@use "sass:math"; +a {b: atan(-2)} -<===> negative_zero/output.css +<===> less_than_negative_one/output.css a { - b: 0deg; + b: -63.4349488229deg; } <===> ================================================================================ -<===> negative_zero_fuzzy/input.scss -a {b: atan(-0.000000000001)} +<===> negative_one/input.scss +a {b: atan(-1)} -<===> negative_zero_fuzzy/output.css +<===> negative_one/output.css a { - b: -0.0000000001deg; + b: -45deg; } <===> @@ -65,73 +56,77 @@ a { <===> ================================================================================ -<===> positive/input.scss +<===> one/input.scss a {b: atan(1)} -<===> positive/output.css +<===> one/output.css a { b: 45deg; } <===> ================================================================================ -<===> infinity/input.scss -@use "sass:math"; -a {b: atan(math.div(1, 0))} +<===> one_fuzzy/input.scss +a {b: atan(1.000000000001)} -<===> infinity/output.css +<===> one_fuzzy/output.css a { - b: 90deg; + b: 45deg; +} + +<===> +================================================================================ +<===> greater_than_one/input.scss +a {b: atan(2)} + +<===> greater_than_one/output.css +a { + b: 63.4349488229deg; } <===> ================================================================================ -<===> preserved/percent/input.scss -a {b: atan(3px - 1.5px + 5%)} +<===> infinity/input.scss +@use "sass:math"; +a {b: atan(math.div(1, 0))} -<===> preserved/percent/output.css +<===> infinity/output.css a { - b: atan(1.5px + 5%); + b: 90deg; } <===> ================================================================================ -<===> preserved/operation/variable/input.scss +<===> operation/simplification/input.scss a { - --test: 5; - b: atan(3px - 1px + var(--test)); + b: atan(3px - 1px + var(--c)); } -<===> preserved/operation/variable/output.css +<===> operation/simplification/output.css a { - --test: 5; - b: atan(2px + var(--test)); + b: atan(2px + var(--c)); } <===> ================================================================================ <===> preserved/variable/input.scss a { - --test: 5; - b: atan(var(--test)); + b: atan(var(--c)); } <===> preserved/variable/output.css a { - --test: 5; - b: atan(var(--test)); + b: atan(var(--c)); } <===> ================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: atan(test); -} +<===> preserved/operation/percentage/input.scss +a {b: atan(17px + 5%)} -<===> preserved/unquoted_string/output.css +<===> preserved/operation/percentage/output.css a { - b: atan(test); + b: atan(17px + 5%); } <===> @@ -147,19 +142,6 @@ Error: Expected 1px to have no units. ' input.scss 1:7 root stylesheet -<===> -================================================================================ -<===> error/percent/input.scss -a {b: atan(1%)} - -<===> error/percent/error -Error: Expected 1% to have no units. - , -1 | a {b: atan(1%)} - | ^^^^^^^^ - ' - input.scss 1:7 root stylesheet - <===> ================================================================================ <===> error/type/input.scss @@ -199,3 +181,15 @@ Error: expected "+", "-", "*", "/", or ")". ' input.scss 1:13 root stylesheet +<===> +================================================================================ +<===> error/named_argument/input.scss +a {b: atan($number: 3)} + +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: atan($number: 3)} + | ^ + ' + input.scss 1:19 root stylesheet diff --git a/spec/values/calculation/atan2.hrx b/spec/values/calculation/atan2.hrx index 4709b074f..a432d5abd 100644 --- a/spec/values/calculation/atan2.hrx +++ b/spec/values/calculation/atan2.hrx @@ -44,62 +44,46 @@ a { <===> ================================================================================ -<===> operation/percent/input.scss -a {b: atan2(4px, 3px - 1.5px + 5%)} - -<===> operation/percent/output.css +<===> operation/simplification/input.scss a { - b: atan2(4px, 1.5px + 5%); + b: atan2(3px - 1px + var(--c), 4px + 10px); } -<===> -================================================================================ -<===> percent/input.scss -a {b: atan2(1%, 1cm)} - -<===> percent/output.css +<===> operation/simplification/output.css a { - b: atan2(1%, 1cm); + b: atan2(2px + var(--c), 14px); } <===> ================================================================================ -<===> preserved/operation/variable/input.scss -a { - --test: 5; - b: atan2(3px - 1px + var(--test), 4px); -} +<===> preserved/y_arg/percentage/input.scss +a {b: atan2(1.5px + 5%, 4px)} -<===> preserved/operation/variable/output.css +<===> preserved/y_arg/percentage/output.css a { - --test: 5; - b: atan2(2px + var(--test), 4px); + b: atan2(1.5px + 5%, 4px); } <===> ================================================================================ -<===> preserved/variable/input.scss -a { - --test: 5; - b: atan2(var(--test)); -} +<===> preserved/x_arg/percentage/input.scss +a {b: atan2(4px, 1.5px + 5%)} -<===> preserved/variable/output.css +<===> preserved/x_arg/percentage/output.css a { - --test: 5; - b: atan2(var(--test)); + b: atan2(4px, 1.5px + 5%); } <===> ================================================================================ -<===> preserved/unquoted_string/input.scss +<===> preserved/variable/input.scss a { - b: atan2(test); + b: atan2(var(--c)); } -<===> preserved/unquoted_string/output.css +<===> preserved/variable/output.css a { - b: atan2(test); + b: atan2(var(--c)); } <===> @@ -114,39 +98,12 @@ a { b: atan2(1foo, 2bar); } -<===> -================================================================================ -<===> error/variables/input.scss -a {b: atan2($y: 1, $x: -1)} - -<===> error/variables/error -Error: expected "+", "-", "*", "/", ",", or ")". - , -1 | a {b: atan2($y: 1, $x: -1)} - | ^ - ' - input.scss 1:15 root stylesheet - <===> ================================================================================ <===> error/incompatible_units/input.scss -a {b: atan2(1px, 1deg)} - -<===> error/incompatible_units/error -Error: 1px and 1deg are incompatible. - , -1 | a {b: atan2(1px, 1deg)} - | ^^^ 1px - | ==== 1deg - ' - input.scss 1:13 root stylesheet - -<===> -================================================================================ -<===> error/unitless_y/input.scss a {b: atan2(1, 1px)} -<===> error/unitless_y/error +<===> error/incompatible_units/error Error: 1 and 1px are incompatible. , 1 | a {b: atan2(1, 1px)} @@ -155,20 +112,6 @@ Error: 1 and 1px are incompatible. ' input.scss 1:13 root stylesheet -<===> -================================================================================ -<===> error/operation/incompatible_units/input.scss -a {b: atan2(10 + 6, 8px - 1cm)} - -<===> error/operation/incompatible_units/error -Error: 16 and -29.7952755906px are incompatible. - , -1 | a {b: atan2(10 + 6, 8px - 1cm)} - | ^^^^^^ 16 - | ========= -29.7952755906px - ' - input.scss 1:13 root stylesheet - <===> ================================================================================ <===> error/one_arg/input.scss @@ -182,19 +125,6 @@ Error: 2 arguments required, but only 1 was passed. ' input.scss 1:7 root stylesheet -<===> -================================================================================ -<===> error/syntax/quoted_string/input.scss -a {b: atan2("0")} - -<===> error/syntax/quoted_string/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: atan2("0")} - | ^ - ' - input.scss 1:13 root stylesheet - <===> ================================================================================ <===> error/syntax/invalid_arg/input.scss @@ -259,3 +189,16 @@ Error: expected "+", "-", "*", "/", or ")". | ^ ' input.scss 1:17 root stylesheet + +<===> +================================================================================ +<===> error/variables/input.scss +a {b: atan2($y: 1, $x: -1)} + +<===> error/variables/error +Error: expected "+", "-", "*", "/", ",", or ")". + , +1 | a {b: atan2($y: 1, $x: -1)} + | ^ + ' + input.scss 1:15 root stylesheet diff --git a/spec/values/calculation/cos.hrx b/spec/values/calculation/cos.hrx index f8427b3e7..a7aa80b0f 100644 --- a/spec/values/calculation/cos.hrx +++ b/spec/values/calculation/cos.hrx @@ -2,28 +2,6 @@ Most of the same behavior tested for `calc()` applies to `cos()`, but for terseness' sake isn't tested explicitly. -<===> -================================================================================ -<===> negative_infinity/input.scss -@use "sass:math"; -a {b: cos(math.div(-1, 0))} - -<===> negative_infinity/output.css -a { - b: calc(NaN); -} - -<===> -================================================================================ -<===> infinity/input.scss -@use "sass:math"; -a {b: cos(math.div(1, 0))} - -<===> infinity/output.css -a { - b: calc(NaN); -} - <===> ================================================================================ <===> deg/input.scss @@ -64,6 +42,17 @@ a { b: 1; } +<===> +================================================================================ +<===> negative_infinity/input.scss +@use "sass:math"; +a {b: cos(math.div(-1, 0))} + +<===> negative_infinity/output.css +a { + b: calc(NaN); +} + <===> ================================================================================ <===> less_than_negative_one/input.scss @@ -76,30 +65,40 @@ a { <===> ================================================================================ -<===> negative_decimal/input.scss -a {b: cos(-0.5)} +<===> negative_one/input.scss +a {b: cos(-1)} + +<===> negative_one/output.css +a { + b: 0.5403023059; +} + +<===> +================================================================================ +<===> zero/input.scss +a {b: cos(0)} -<===> negative_decimal/output.css +<===> zero/output.css a { - b: 0.8775825619; + b: 1; } <===> ================================================================================ -<===> decimal/input.scss -a {b: cos(0.5)} +<===> zero_fuzzy/input.scss +a {b: cos(0.000000000001)} -<===> decimal/output.css +<===> zero_fuzzy/output.css a { - b: 0.8775825619; + b: 1; } <===> ================================================================================ -<===> unitless/input.scss +<===> one/input.scss a {b: cos(1)} -<===> unitless/output.css +<===> one/output.css a { b: 0.5403023059; } @@ -124,6 +123,17 @@ a { b: -0.4161468365; } +<===> +================================================================================ +<===> infinity/input.scss +@use "sass:math"; +a {b: cos(math.div(1, 0))} + +<===> infinity/output.css +a { + b: calc(NaN); +} + <===> ================================================================================ <===> preserved/percent/input.scss @@ -138,40 +148,24 @@ a { ================================================================================ <===> preserved/operation/variable/input.scss a { - --test: 5; - b: cos(3px - 1px + var(--test)); + b: cos(3px - 1px + var(--c)); } <===> preserved/operation/variable/output.css a { - --test: 5; - b: cos(2px + var(--test)); + b: cos(2px + var(--c)); } <===> ================================================================================ <===> preserved/variable/input.scss a { - --test: 5; - b: cos(var(--test)); + b: cos(var(--c)); } <===> preserved/variable/output.css a { - --test: 5; - b: cos(var(--test)); -} - -<===> -================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: cos(test); -} - -<===> preserved/unquoted_string/output.css -a { - b: cos(test); + b: cos(var(--c)); } <===> @@ -241,13 +235,13 @@ Error: Expected identifier. <===> ================================================================================ -<===> percent/input.scss -a {b: cos(1%)} +<===> error/named_argument/input.scss +a {b: cos($number: 3)} -<===> percent/error -Error: $number: Expected 1% to have an angle unit (deg, grad, rad, turn). +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". , -1 | a {b: cos(1%)} - | ^^^^^^^ +1 | a {b: cos($number: 3)} + | ^ ' - input.scss 1:7 root stylesheet + input.scss 1:18 root stylesheet diff --git a/spec/values/calculation/exp.hrx b/spec/values/calculation/exp.hrx index ffa1f94fc..6e913626f 100644 --- a/spec/values/calculation/exp.hrx +++ b/spec/values/calculation/exp.hrx @@ -4,172 +4,152 @@ terseness' sake isn't tested explicitly. <===> ================================================================================ -<===> error/syntax/no_arg/input.scss -a {b: calc(exp())} +<===> zero/input.scss +a {b: exp(0)} -<===> error/syntax/no_arg/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: calc(exp())} - | ^ - ' - input.scss 1:16 root stylesheet - -<===> -================================================================================ -<===> error/syntax/many_args/input.scss -a {b: calc(exp(3, 2))} - -<===> error/syntax/many_args/error -Error: expected "+", "-", "*", "/", or ")". - , -1 | a {b: calc(exp(3, 2))} - | ^ - ' - input.scss 1:17 root stylesheet +<===> zero/output.css +a { + b: 1; +} <===> ================================================================================ -<===> error/syntax/operation_incompatible/input.scss -a {b: exp(1 + 16px)} +<===> positive/input.scss +a {b: exp(5)} -<===> error/syntax/operation_incompatible/error -Error: 1 and 16px are incompatible. - , -1 | a {b: exp(1 + 16px)} - | ^^^^^^^^ - ' - input.scss 1:11 root stylesheet +<===> positive/output.css +a { + b: 148.4131591026; +} <===> ================================================================================ -<===> error/syntax/invalid_arg/input.scss -a {b: calc(exp($))} +<===> negative/input.scss +a {b: exp(-10.5)} -<===> error/syntax/invalid_arg/error -Error: Expected identifier. - , -1 | a {b: calc(exp($))} - | ^ - ' - input.scss 1:17 root stylesheet +<===> negative/output.css +a { + b: 0.0000275364; +} <===> ================================================================================ -<===> error/complex_unit/input.scss -a {b: exp(1px*1px)} +<===> result_is_infinity/input.scss +a {b: exp(1000.65)} -<===> error/complex_unit/error -Error: Number 1px*px isn't compatible with CSS calculations. - , -1 | a {b: exp(1px*1px)} - | ^^^^^^^ - ' - input.scss 1:11 root stylesheet +<===> result_is_infinity/output.css +a { + b: calc(infinity); +} <===> ================================================================================ -<===> error/percentage/input.scss -a {b: exp(5%)} +<===> operation/simplification/input.scss +a { + b: exp(1px + 2px - var(--c)) +} -<===> error/percentage/error -Error: Expected 5% to have no units. - , -1 | a {b: exp(5%)} - | ^^^^^^^ - ' - input.scss 1:7 root stylesheet +<===> operation/simplification/output.css +a { + b: exp(3px - var(--c)); +} <===> ================================================================================ -<===> error/unit/input.scss -a {b: exp(5px)} - -<===> error/unit/error -Error: Expected 5px to have no units. - , -1 | a {b: exp(5px)} - | ^^^^^^^^ - ' - input.scss 1:7 root stylesheet +<===> preserved/operation/percentage/input.scss +a {b: exp(3px - 1.5px + 5%)} +<===> preserved/operation/percentage/output.css +a { + b: exp(1.5px + 5%); +} <===> ================================================================================ -<===> operation/unitless/result_is_integer/input.scss -a {b: exp(5)} +<===> preserved/variable/input.scss +a { + b: exp(var(--c)); +} -<===> operation/unitless/result_is_integer/output.css +<===> preserved/variable/output.css a { - b: 148.4131591026; + b: exp(var(--c)); } <===> ================================================================================ -<===> operation/unitless/result_is_long/input.scss -a {b: exp(1000.65)} +<===> error/units/input.scss +a {b: exp(1px)} -<===> operation/unitless/result_is_long/output.css -a { - b: calc(infinity); -} +<===> error/units/error +Error: Expected 1px to have no units. + , +1 | a {b: exp(1px)} + | ^^^^^^^^ + ' + input.scss 1:7 root stylesheet <===> ================================================================================ -<===> operation/math_nested/negative/input.scss -a {b: calc(exp(5 * 8 - 100))} +<===> error/type/input.scss +a {b: exp("0")} -<===> operation/math_nested/negative/output.css -a { - b: 0; -} +<===> error/type/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: exp("0")} + | ^ + ' + input.scss 1:11 root stylesheet <===> ================================================================================ -<===> preserved/percent/input.scss -a {b: exp(3px - 1.5px + 5%)} +<===> error/zero_args/input.scss +a {b: exp()} -<===> preserved/percent/output.css -a { - b: exp(1.5px + 5%); -} +<===> error/zero_args/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: exp()} + | ^ + ' + input.scss 1:11 root stylesheet <===> ================================================================================ -<===> preserved/operation/variable/input.scss -a { - --test: 5; - b: exp(3px - 1px + var(--test)); -} +<===> error/too_many_args/input.scss +a {b: exp(0, 0)} -<===> preserved/operation/variable/output.css -a { - --test: 5; - b: exp(2px + var(--test)); -} +<===> error/too_many_args/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: exp(0, 0)} + | ^ + ' + input.scss 1:12 root stylesheet <===> ================================================================================ -<===> preserved/variable/input.scss -a { - --test: 5; - b: exp(var(--test)); -} +<===> error/syntax/invalid_arg/input.scss +a {b: exp($)} -<===> preserved/variable/output.css -a { - --test: 5; - b: exp(var(--test)); -} +<===> error/syntax/invalid_arg/error +Error: Expected identifier. + , +1 | a {b: exp($)} + | ^ + ' + input.scss 1:12 root stylesheet <===> ================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: exp(test); -} +<===> error/named_argument/input.scss +a {b: exp($number: 3)} -<===> preserved/unquoted_string/output.css -a { - b: exp(test); -} +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: exp($number: 3)} + | ^ + ' + input.scss 1:18 root stylesheet diff --git a/spec/values/calculation/hypot.hrx b/spec/values/calculation/hypot.hrx index 0a51b2f8d..4934ff671 100644 --- a/spec/values/calculation/hypot.hrx +++ b/spec/values/calculation/hypot.hrx @@ -14,24 +14,24 @@ a { <===> ================================================================================ -<===> variable/input.scss -$number: 3; -a {b: hypot(3 + 10, 4, 5, 6, 7)} +<===> compatible_units/input.scss +@use "sass:math"; +a {b: hypot(13cm, 4mm, 5q, 6in, 7px)} -<===> variable/output.css +<===> compatible_units/output.css a { - b: 17.1755640373; + b: 20.0366545892cm; } <===> ================================================================================ -<===> compatible_units/input.scss +<===> simplification/input.scss @use "sass:math"; -a {b: hypot(3cm, 4mm * 10, 5q * 40, math.div(6in, 2.54), 7px * math.div(96, 2.54))} +a {b: hypot(3 + 2, 4 * 10, 5 * 40, math.div(6, 2.54), 7 * math.div(96, 2.54))} -<===> compatible_units/output.css +<===> simplification/output.css a { - b: 11.6189500386cm; + b: 334.1051331579; } <===> @@ -56,32 +56,9 @@ a { b: calc(infinity); } -<===> -================================================================================ -<===> infinity/third/input.scss -@use "sass:math"; -a {b: hypot(1, 1, math.div(1, 0))} - -<===> infinity/third/output.css -a { - b: calc(infinity); -} - -<===> -================================================================================ -<===> math/plus/input.scss -@use "sass:math"; -a {b: hypot(10*3, 15, 70/2)} - -<===> math/plus/output.css -a { - b: 48.4767985742; -} - <===> ================================================================================ <===> percentage/input.scss -@use "sass:math"; a {b: hypot(10%, 5%)} <===> percentage/output.css @@ -93,15 +70,11 @@ a { ================================================================================ <===> preserved/variable/two_args/input.scss b { ---x: 4px ---y: 6px; a: hypot(var(--x), var(--y)); } <===> preserved/variable/two_args/output.css b { - --x: 4px - --y: 6px; a: hypot(var(--x), var(--y)); } @@ -109,13 +82,11 @@ b { ================================================================================ <===> preserved/variable/one_arg/input.scss b { ---example: 4px, 6px; a: hypot(var(--example)); } <===> preserved/variable/one_arg/output.css b { - --example: 4px, 6px; a: hypot(var(--example)); } @@ -133,27 +104,14 @@ a { ================================================================================ <===> preserved/operation/variable/input.scss a { - --test: 5; - b: hypot(3px - 1px + var(--test)); + b: hypot(3px - 1px + var(--c)); } <===> preserved/operation/variable/output.css a { - --test: 5; - b: hypot(2px + var(--test)); -} - -<===> -================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: hypot(test); + b: hypot(2px + var(--c)); } -<===> preserved/unquoted_string/output.css -a { - b: hypot(test); -} <===> ================================================================================ @@ -167,45 +125,6 @@ a { b: hypot(1foo, 2bar); } -<===> -================================================================================ -<===> error/type/first/input.scss -a {b: hypot("0", 1px, 1px)} - -<===> error/type/first/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: hypot("0", 1px, 1px)} - | ^ - ' - input.scss 1:13 root stylesheet - -<===> -================================================================================ -<===> error/type/second/input.scss -a {b: hypot(1px, "0", 1px)} - -<===> error/type/second/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: hypot(1px, "0", 1px)} - | ^ - ' - input.scss 1:18 root stylesheet - -<===> -================================================================================ -<===> error/type/third/input.scss -a {b: hypot(1px, 1px, "0")} - -<===> error/type/third/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: hypot(1px, 1px, "0")} - | ^ - ' - input.scss 1:23 root stylesheet - <===> ================================================================================ <===> error/incompatible_units/first_and_second/input.scss @@ -223,14 +142,14 @@ Error: 1deg and 1px are incompatible. <===> ================================================================================ <===> error/incompatible_units/first_and_third/input.scss -a {b: hypot(1deg, 1turn, 1px)} +a {b: hypot(1deg, 1turn, 1)} <===> error/incompatible_units/first_and_third/error -Error: 1deg and 1px are incompatible. +Error: 1deg and 1 are incompatible. , -1 | a {b: hypot(1deg, 1turn, 1px)} +1 | a {b: hypot(1deg, 1turn, 1)} | ^^^^ 1deg - | === 1px + | = 1 ' input.scss 1:13 root stylesheet @@ -250,111 +169,65 @@ Error: 1turn and 1px are incompatible. <===> ================================================================================ -<===> error/incompatible_units/all/input.scss -a {b: hypot(1turn, 1px, 1s)} - -<===> error/incompatible_units/all/error -Error: 1turn and 1px are incompatible. - , -1 | a {b: hypot(1turn, 1px, 1s)} - | ^^^^^ 1turn - | === 1px - ' - input.scss 1:13 root stylesheet - -<===> -================================================================================ -<===> error/some_unitless/first/input.scss -a {b: hypot(0, 1px, 2px)} - -<===> error/some_unitless/first/error -Error: 0 and 1px are incompatible. - , -1 | a {b: hypot(0, 1px, 2px)} - | ^ 0 - | === 1px - ' - input.scss 1:13 root stylesheet - -<===> -================================================================================ -<===> error/some_unitless/second/input.scss -a {b: hypot(0px, 1, 2px)} - -<===> error/some_unitless/second/error -Error: 0px and 1 are incompatible. - , -1 | a {b: hypot(0px, 1, 2px)} - | ^^^ 0px - | = 1 - ' - input.scss 1:13 root stylesheet - -<===> -================================================================================ -<===> error/some_unitless/third/input.scss -a {b: hypot(0px, 1px, 2)} +<===> error/type/first/input.scss +a {b: hypot("0", 1px, 1px)} -<===> error/some_unitless/third/error -Error: 0px and 2 are incompatible. +<===> error/type/first/error +Error: Expected number, variable, function, or calculation. , -1 | a {b: hypot(0px, 1px, 2)} - | ^^^ 0px - | = 2 +1 | a {b: hypot("0", 1px, 1px)} + | ^ ' input.scss 1:13 root stylesheet <===> ================================================================================ -<===> error/some_unitless/first_and_second/input.scss -a {b: hypot(0, 1, 2px)} +<===> error/type/second/input.scss +a {b: hypot(1px, "0", 1px)} -<===> error/some_unitless/first_and_second/error -Error: 0 and 2px are incompatible. +<===> error/type/second/error +Error: Expected number, variable, function, or calculation. , -1 | a {b: hypot(0, 1, 2px)} - | ^ 0 - | === 2px +1 | a {b: hypot(1px, "0", 1px)} + | ^ ' - input.scss 1:13 root stylesheet + input.scss 1:18 root stylesheet <===> ================================================================================ -<===> error/some_unitless/first_and_third/input.scss -a {b: hypot(0, 1px, 2)} +<===> error/zero_args/input.scss +a {b: hypot()} -<===> error/some_unitless/first_and_third/error -Error: 0 and 1px are incompatible. +<===> error/zero_args/error +Error: Expected number, variable, function, or calculation. , -1 | a {b: hypot(0, 1px, 2)} - | ^ 0 - | === 1px +1 | a {b: hypot()} + | ^ ' input.scss 1:13 root stylesheet <===> ================================================================================ -<===> error/some_unitless/second_and_third/input.scss -a {b: hypot(0px, 1, 2)} +<===> error/syntax/invalid_arg/input.scss +a {b: hypot($)} -<===> error/some_unitless/second_and_third/error -Error: 0px and 1 are incompatible. +<===> error/syntax/invalid_arg/error +Error: Expected identifier. , -1 | a {b: hypot(0px, 1, 2)} - | ^^^ 0px - | = 1 +1 | a {b: hypot($)} + | ^ ' - input.scss 1:13 root stylesheet + input.scss 1:14 root stylesheet <===> ================================================================================ -<===> error/zero_args/input.scss -a {b: hypot()} +<===> error/named_argument/input.scss +a {b: hypot($number: 3)} -<===> error/zero_args/error -Error: Expected number, variable, function, or calculation. +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", ",", or ")". , -1 | a {b: hypot()} - | ^ +1 | a {b: hypot($number: 3)} + | ^ ' - input.scss 1:13 root stylesheet + input.scss 1:20 root stylesheet diff --git a/spec/values/calculation/log.hrx b/spec/values/calculation/log.hrx index bc1e86948..3ecf02c0e 100644 --- a/spec/values/calculation/log.hrx +++ b/spec/values/calculation/log.hrx @@ -53,16 +53,6 @@ a { b: calc(infinity); } -<===> -================================================================================ -<===> base/null/input.scss -a {b: log(2)} - -<===> base/null/output.css -a { - b: 0.6931471806; -} - <===> ================================================================================ <===> base/negative/input.scss @@ -83,16 +73,6 @@ a { b: 0; } -<===> -================================================================================ -<===> base/zero_fuzzy/input.scss -a {b: log(2, 0.000000000001)} - -<===> base/zero_fuzzy/output.css -a { - b: -0.025085833; -} - <===> ================================================================================ <===> base/between_zero_and_one/input.scss @@ -113,16 +93,6 @@ a { b: calc(infinity); } -<===> -================================================================================ -<===> base/one_fuzzy/input.scss -a {b: log(2, 1.000000000001)} - -<===> base/one_fuzzy/output.css -a { - b: 693085564849.9645; -} - <===> ================================================================================ <===> base/positive/input.scss @@ -135,94 +105,81 @@ a { <===> ================================================================================ -<===> base/unknown_variable/input.scss -a {b: log(2, test)} +<===> base/variable/input.scss +a {b: log(2, var(--c))} -<===> base/unknown_variable/output.css +<===> base/variable/output.css a { - b: log(2, test); + b: log(2, var(--c)); } <===> ================================================================================ -<===> base/calculation/input.scss -a {b: log(2px, 3px + 10px)} +<===> operation/simplification/input.scss +a { + b: log(3px - 1px + var(--c)); +} -<===> base/calculation/error -Error: Expected 2px to have no units. - , -1 | a {b: log(2px, 3px + 10px)} - | ^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet +<===> operation/simplification/output.css +a { + b: log(2px + var(--c)); +} <===> ================================================================================ <===> preserved/variable/input.scss a { - --two-args: 2, 3; - b: log(var(--two-args)); + b: log(var(--c)); } <===> preserved/variable/output.css a { - --two-args: 2, 3; - b: log(var(--two-args)); + b: log(var(--c)); } <===> ================================================================================ -<===> preserved/percent/input.scss +<===> preserved/operation/percentage/input.scss a {b: log(3px - 1.5px + 5%)} -<===> preserved/percent/output.css +<===> preserved/operation/percentage/output.css a { b: log(1.5px + 5%); } <===> ================================================================================ -<===> preserved/operation/variable/input.scss -a { - --test: 5; - b: log(3px - 1px + var(--test)); -} - -<===> preserved/operation/variable/output.css -a { - --test: 5; - b: log(2px + var(--test)); -} - -<===> -================================================================================ -<===> named_arg/number/input.scss -$number: 2; -a {b: log($number)} +<===> error/number_has_units/input.scss +a {b: log(3px)} -<===> named_arg/number/output.css -a { - b: 0.6931471806; -} +<===> error/number_has_units/error +Error: Expected 3px to have no units. + , +1 | a {b: log(3px)} + | ^^^^^^^^ + ' + input.scss 1:7 root stylesheet <===> ================================================================================ -<===> named_args/number_with_base/input.scss -$number: 2; -$base: 10; -a {b: log($number, $base)} +<===> error/base_has_units/input.scss +a {b: log(1, 1px)} -<===> named_args/number_with_base/output.css -a { - b: 0.3010299957; -} +<===> error/base_has_units/error +Error: 1 and 1px are incompatible. + , +1 | a {b: log(1, 1px)} + | ^ 1 + | === 1px + ' + input.scss 1:11 root stylesheet <===> ================================================================================ -<===> error/type/input.scss +<===> error/number_type/input.scss a {b: log("0")} -<===> error/type/error +<===> error/number_type/error Error: Expected number, variable, function, or calculation. , 1 | a {b: log("0")} @@ -232,17 +189,16 @@ Error: Expected number, variable, function, or calculation. <===> ================================================================================ -<===> error/base_has_units/input.scss -a {b: log(1, 1px)} +<===> error/base_type/input.scss +a {b: log(0, "0")} -<===> error/base_has_units/error -Error: 1 and 1px are incompatible. +<===> error/base_type/error +Error: Expected number, variable, function, or calculation. , -1 | a {b: log(1, 1px)} - | ^ 1 - | === 1px +1 | a {b: log(0, "0")} + | ^ ' - input.scss 1:11 root stylesheet + input.scss 1:14 root stylesheet <===> ================================================================================ @@ -272,81 +228,26 @@ Error: expected "+", "-", "*", "/", or ")". <===> ================================================================================ -<===> error/syntax/quoted_string/input.scss -a {b: log("test")} - -<===> error/syntax/quoted_string/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: log("test")} - | ^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/unit/percentage/input.scss -a {b: log(5%, 3%)} - -<===> error/unit/percentage/error -Error: Expected 5% to have no units. - , -1 | a {b: log(5%, 3%)} - | ^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/compatible_units/input.scss -a {b: log(10px, 10px)} - -<===> error/compatible_units/error -Error: Expected 10px to have no units. - , -1 | a {b: log(10px, 10px)} - | ^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/unknown_units/input.scss -a { - b: log(1foo, 2bar); -} - -<===> error/unknown_units/error -Error: Expected 1foo to have no units. - , -2 | b: log(1foo, 2bar); - | ^^^^^^^^^^^^^^^ - ' - input.scss 2:6 root stylesheet - -<===> -================================================================================ -<===> error/incompatible_units/input.scss -a {b: log(7em, -3deg)} +<===> error/syntax/invalid_arg/input.scss +a {b: log($)} -<===> error/incompatible_units/error -Error: 7em and -3deg are incompatible. +<===> error/syntax/invalid_arg/error +Error: Expected identifier. , -1 | a {b: log(7em, -3deg)} - | ^^^ 7em - | ===== -3deg +1 | a {b: log($)} + | ^ ' - input.scss 1:11 root stylesheet + input.scss 1:12 root stylesheet <===> ================================================================================ -<===> single_number/units/input.scss -a {b: log(3px)} +<===> error/named_argument/input.scss +a {b: log($number: 1)} -<===> single_number/units/error -Error: Expected 3px to have no units. +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", ",", or ")". , -1 | a {b: log(3px)} - | ^^^^^^^^ +1 | a {b: log($number: 1)} + | ^ ' - input.scss 1:7 root stylesheet + input.scss 1:18 root stylesheet diff --git a/spec/values/calculation/mod.hrx b/spec/values/calculation/mod.hrx index 0348ca374..0bf670552 100644 --- a/spec/values/calculation/mod.hrx +++ b/spec/values/calculation/mod.hrx @@ -4,247 +4,92 @@ terseness' sake isn't tested explicitly. <===> ================================================================================ -<===> error/syntax/no_arg/input.scss -a {b: mod()} - -<===> error/syntax/no_arg/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: mod()} - | ^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/missing_arg/input.scss -a {b: mod(3)} - -<===> error/syntax/missing_arg/error -Error: 2 arguments required, but only 1 was passed. - , -1 | a {b: mod(3)} - | ^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/syntax/many_args/input.scss -a {b: mod(3, 2, 1)} - -<===> error/syntax/many_args/error -Error: expected "+", "-", "*", "/", or ")". - , -1 | a {b: mod(3, 2, 1)} - | ^ - ' - input.scss 1:15 root stylesheet - -<===> -================================================================================ -<===> error/syntax/incompatible/input.scss -a {b: mod(16px, 5)} - -<===> error/syntax/incompatible/error -Error: 16px and 5 are incompatible. - , -1 | a {b: mod(16px, 5)} - | ^^^^ 16px - | = 5 - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/operation_incompatible/input.scss -a {b: mod(1 + 16px, 2)} - -<===> error/syntax/operation_incompatible/error -Error: 1 and 16px are incompatible. - , -1 | a {b: mod(1 + 16px, 2)} - | ^^^^^^^^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/min_incompatible/input.scss -a {b: mod(min(16, 9px), 6)} - -<===> error/syntax/min_incompatible/error -Error: 9px and 6 are incompatible. - , -1 | a {b: mod(min(16, 9px), 6)} - | ^^^^^^^^^^^^ 9px - | = 6 - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/invalid_arg/input.scss -a {b: mod($)} - -<===> error/syntax/invalid_arg/error -Error: Expected identifier. - , -1 | a {b: mod($)} - | ^ - ' - input.scss 1:12 root stylesheet - -<===> -================================================================================ -<===> error/syntax/quoted_string/input.scss -a {b: mod("test")} - -<===> error/syntax/quoted_string/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: mod("test")} - | ^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/one_arg/input.scss -a {b: mod(4)} - -<===> error/syntax/one_arg/error -Error: 2 arguments required, but only 1 was passed. - , -1 | a {b: mod(4)} - | ^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/complex_unit/input.scss -a {b: mod(1px*1px, 2)} - -<===> error/complex_unit/error -Error: Number 1px*px isn't compatible with CSS calculations. - , -1 | a {b: mod(1px*1px, 2)} - | ^^^^^^^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/incompatible_units/input.scss -a {b: mod(7em, -3deg)} - -<===> error/incompatible_units/error -Error: 7em and -3deg are incompatible. - , -1 | a {b: mod(7em, -3deg)} - | ^^^ 7em - | ===== -3deg - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/unit/input.scss +<===> percentage/input.scss a {b: mod(5%, 3%)} -<===> error/unit/output.css +<===> percentage/output.css a { b: 2%; } <===> ================================================================================ -<===> operation/unitless/positive_args/input.scss +<===> unitless/input.scss a {b: mod(7, 3)} -<===> operation/unitless/positive_args/output.css +<===> unitless/output.css a { b: 1; } <===> ================================================================================ -<===> operation/unitless/y_negative/input.scss +<===> units/input.scss a {b: mod(7px, -3px)} -<===> operation/unitless/y_negative/output.css +<===> units/output.css a { b: -2px; } <===> ================================================================================ -<===> operation/unitless/x_negative/input.scss -a {b: mod(-7, 3)} +<===> y_zero/input.scss +a {b: mod(6, 0)} -<===> operation/unitless/x_negative/output.css +<===> y_zero/output.css a { - b: 2; + b: calc(NaN); } <===> ================================================================================ -<===> operation/unitless/negative_args/input.scss -a {b: mod(-7, -3)} +<===> x_zero/input.scss +a {b: mod(0, 6)} -<===> operation/unitless/negative_args/output.css +<===> x_zero/output.css a { - b: -1; + b: 0; } <===> ================================================================================ -<===> operation/y_zero/plus/input.scss -a {b: mod(6, 0)} +<===> zeros/input.scss +a {b: mod(0, 0)} -<===> operation/y_zero/plus/output.css +<===> zeros/output.css a { b: calc(NaN); } <===> ================================================================================ -<===> operation/x_zero/plus/input.scss -a {b: mod(0, 6)} - -<===> operation/x_zero/plus/output.css -a { - b: 0; -} - -<===> -================================================================================ -<===> operation/zeros/plus/input.scss -a {b: mod(0, 0)} +<===> negative_zero/input.scss +@use "sass:math"; +a {b: math.div(1, mod(-7, 7))} -<===> operation/zeros/plus/output.css +<===> negative_zero/output.css a { - b: calc(NaN); + b: calc(infinity); } <===> ================================================================================ -<===> operation/y_infinity/plus/input.scss +<===> operation/y_infinity/positive/input.scss @use "sass:math"; -a {b: mod(math.div(1, 0), 10)} +a {b: mod(infinity, 10)} -<===> operation/y_infinity/plus/output.css +<===> operation/y_infinity/positive/output.css a { b: calc(NaN); } <===> ================================================================================ -<===> operation/x_infinity/plus/input.scss +<===> operation/x_infinity/positive/input.scss a {b: mod(10, infinity)} -<===> operation/x_infinity/plus/output.css +<===> operation/x_infinity/positive/output.css a { b: 10; } @@ -261,60 +106,174 @@ a { <===> ================================================================================ -<===> operation/x_infinity/positive/input.scss +<===> operation/x_infinity/y_negative/input.scss a {b: mod(-10, infinity)} -<===> operation/x_infinity/positive/output.css +<===> operation/x_infinity/y_negative/output.css a { b: calc(NaN); } <===> ================================================================================ -<===> preserved/unknown_units/input.scss +<===> operation/simplification/input.scss a { - b: mod(1foo, 2bar); + b: mod(3px - 1px + var(--c), 4px + 10px); } -<===> preserved/unknown_units/output.css +<===> operation/simplification/output.css a { - b: mod(1foo, 2bar); + b: mod(2px + var(--c), 14px); } <===> ================================================================================ -<===> preserved/variable/input.scss -a { - --two-args: 2, 3; - b: mod(var(--two-args)); -} +<===> preserved/percentage/input.scss +a {b: mod(4px + 3%, 3px - 1.5px + 5%)} -<===> preserved/variable/output.css +<===> preserved/percentage/output.css a { - --two-args: 2, 3; - b: mod(var(--two-args)); + b: mod(4px + 3%, 1.5px + 5%); } <===> ================================================================================ -<===> preserved/percent/input.scss -a {b: mod(4px, 3px - 1.5px + 5%)} +<===> preserved/variable/input.scss +a { + b: mod(var(--c)); +} -<===> preserved/percent/output.css +<===> preserved/variable/output.css a { - b: mod(4px, 1.5px + 5%); + b: mod(var(--c)); } <===> ================================================================================ -<===> preserved/operation/variable/input.scss +<===> preserved/unknown_units/input.scss a { - --test: 5; - b: mod(3px - 1px + var(--test), 4px); + b: mod(1foo, 2bar); } -<===> preserved/operation/variable/output.css +<===> preserved/unknown_units/output.css a { - --test: 5; - b: mod(2px + var(--test), 4px); + b: mod(1foo, 2bar); } + +<===> +================================================================================ +<===> error/variables/input.scss +a {b: mod($dividend: 1, $modulus: -1)} + +<===> error/variables/error +Error: expected "+", "-", "*", "/", ",", or ")". + , +1 | a {b: mod($dividend: 1, $modulus: -1)} + | ^ + ' + input.scss 1:20 root stylesheet + +<===> +================================================================================ +<===> error/incompatible_units/input.scss +a {b: mod(16px, 5)} + +<===> error/incompatible_units/error +Error: 16px and 5 are incompatible. + , +1 | a {b: mod(16px, 5)} + | ^^^^ 16px + | = 5 + ' + input.scss 1:11 root stylesheet + +<===> +================================================================================ +<===> error/syntax/missing_arg/input.scss +a {b: mod(3)} + +<===> error/syntax/missing_arg/error +Error: 2 arguments required, but only 1 was passed. + , +1 | a {b: mod(3)} + | ^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/syntax/invalid_arg/input.scss +a {b: mod($)} + +<===> error/syntax/invalid_arg/error +Error: Expected identifier. + , +1 | a {b: mod($)} + | ^ + ' + input.scss 1:12 root stylesheet + +<===> +================================================================================ +<===> error/modulus_type/input.scss +a {b: mod(0, "0")} + +<===> error/modulus_type/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: mod(0, "0")} + | ^ + ' + input.scss 1:14 root stylesheet + +<===> +================================================================================ +<===> error/dividend_type/input.scss +a {b: mod("0", 0)} + +<===> error/dividend_type/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: mod("0", 0)} + | ^ + ' + input.scss 1:11 root stylesheet + +<===> +================================================================================ +<===> error/no_arg/input.scss +a {b: mod()} + +<===> error/no_arg/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: mod()} + | ^ + ' + input.scss 1:11 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: mod(3, 2, 1)} + +<===> error/too_many_args/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: mod(3, 2, 1)} + | ^ + ' + input.scss 1:15 root stylesheet + +<===> +================================================================================ +<===> error/named_argument/input.scss +a {b: mod($number: 3)} + +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", ",", or ")". + , +1 | a {b: mod($number: 3)} + | ^ + ' + input.scss 1:18 root stylesheet diff --git a/spec/values/calculation/pow.hrx b/spec/values/calculation/pow.hrx index 4f0c93f59..e444d2f8f 100644 --- a/spec/values/calculation/pow.hrx +++ b/spec/values/calculation/pow.hrx @@ -4,162 +4,74 @@ terseness' sake isn't tested explicitly. <===> ================================================================================ -<===> error/syntax/no_arg/input.scss -a {b: pow()} - -<===> error/syntax/no_arg/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: pow()} - | ^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/missing_arg/input.scss -a {b: pow(3)} - -<===> error/syntax/missing_arg/error -Error: 2 arguments required, but only 1 was passed. - , -1 | a {b: pow(3)} - | ^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/syntax/quoted_string/input.scss -a {b: pow("test")} - -<===> error/syntax/quoted_string/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: pow("test")} - | ^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/many_args/input.scss -a {b: pow(3, 2, 1)} - -<===> error/syntax/many_args/error -Error: expected "+", "-", "*", "/", or ")". - , -1 | a {b: pow(3, 2, 1)} - | ^ - ' - input.scss 1:15 root stylesheet - -<===> -================================================================================ -<===> error/syntax/incompatible/input.scss -a {b: pow(16px, 5)} - -<===> error/syntax/incompatible/error -Error: 16px and 5 are incompatible. - , -1 | a {b: pow(16px, 5)} - | ^^^^ 16px - | = 5 - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/operation_incompatible/input.scss -a {b: pow(1 + 16px, 2)} +<===> positive/input.scss +a {b: pow(10, 10)} -<===> error/syntax/operation_incompatible/error -Error: 1 and 16px are incompatible. - , -1 | a {b: pow(1 + 16px, 2)} - | ^^^^^^^^ - ' - input.scss 1:11 root stylesheet +<===> positive/output.css +a { + b: 10000000000; +} <===> ================================================================================ -<===> error/syntax/min_incompatible/input.scss -a {b: pow(min(16, 9px), 6)} +<===> base/negative/input.scss +a {b: pow(-10, 10)} -<===> error/syntax/min_incompatible/error -Error: 9px and 6 are incompatible. - , -1 | a {b: pow(min(16, 9px), 6)} - | ^^^^^^^^^^^^ 9px - | = 6 - ' - input.scss 1:11 root stylesheet +<===> base/negative/output.css +a { + b: 10000000000; +} <===> ================================================================================ -<===> error/syntax/invalid_arg/input.scss -a {b: pow($)} +<===> exponent/negative/input.scss +a {b: pow(10, -10)} -<===> error/syntax/invalid_arg/error -Error: Expected identifier. - , -1 | a {b: pow($)} - | ^ - ' - input.scss 1:12 root stylesheet +<===> exponent/negative/output.css +a { + b: 0.0000000001; +} <===> ================================================================================ -<===> error/syntax/one_arg/input.scss -a {b: pow(4)} +<===> zeros/input.scss +a {b: pow(0, 0)} -<===> error/syntax/one_arg/error -Error: 2 arguments required, but only 1 was passed. - , -1 | a {b: pow(4)} - | ^^^^^^ - ' - input.scss 1:7 root stylesheet +<===> zeros/output.css +a { + b: 1; +} <===> ================================================================================ -<===> error/complex_unit/input.scss -a {b: pow(1px*1px, 2)} +<===> operation/y_infinity/positive/input.scss +@use "sass:math"; +a {b: mod(infinity, 10)} -<===> error/complex_unit/error -Error: Number 1px*px isn't compatible with CSS calculations. - , -1 | a {b: pow(1px*1px, 2)} - | ^^^^^^^ - ' - input.scss 1:11 root stylesheet +<===> operation/y_infinity/positive/output.css +a { + b: calc(NaN); +} <===> ================================================================================ -<===> error/with_units/input.scss -a {b: pow(4deg, 10em)} +<===> operation/x_infinity/positive/input.scss +a {b: mod(10, infinity)} -<===> error/with_units/error -Error: 4deg and 10em are incompatible. - , -1 | a {b: pow(4deg, 10em)} - | ^^^^ 4deg - | ==== 10em - ' - input.scss 1:11 root stylesheet +<===> operation/x_infinity/positive/output.css +a { + b: 10; +} <===> ================================================================================ -<===> percentage/unit/input.scss -a {b: pow(5%, 3%)} +<===> operation/simplification/input.scss +a {b: pow(3px - 1px + var(--c), 4px + 10px)} -<===> percentage/unit/error -Error: Expected 5% to have no units. - , -1 | a {b: pow(5%, 3%)} - | ^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet +<===> operation/simplification/output.css +a { + b: pow(2px + var(--c), 14px); +} <===> ================================================================================ @@ -176,125 +88,127 @@ Error: Expected 10px to have no units. <===> ================================================================================ -<===> operation/unitless/result_is_integer/input.scss -a {b: pow(2, 3)} - -<===> operation/unitless/result_is_integer/output.css +<===> preserved/variable/input.scss a { - b: 8; + b: pow(var(--c)); } -<===> -================================================================================ -<===> operation/unitless/result_is_long/input.scss -a {b: pow(10, 10)} - -<===> operation/unitless/result_is_long/output.css +<===> preserved/variable/output.css a { - b: 10000000000; + b: pow(var(--c)); } <===> ================================================================================ -<===> operation/math_nested/minus/input.scss -a {b: pow(3 - 1, 2)} +<===> preserved/percent/input.scss +a {b: pow(4px, 3px - 1.5px + 5%)} -<===> operation/math_nested/minus/output.css +<===> preserved/percent/output.css a { - b: 4; + b: pow(4px, 1.5px + 5%); } <===> ================================================================================ -<===> operation/math/plus/input.scss -a {b: pow(10 + 6, 0)} +<===> error/syntax/incompatible/input.scss +a {b: pow(16, 5px)} -<===> operation/math/plus/output.css -a { - b: 1; -} +<===> error/syntax/incompatible/error +Error: 16 and 5px are incompatible. + , +1 | a {b: pow(16, 5px)} + | ^^ 16 + | === 5px + ' + input.scss 1:11 root stylesheet <===> ================================================================================ -<===> operation/math/max/input.scss -a {b: pow(max(2, 9), 2)} +<===> error/syntax/invalid_arg/input.scss +a {b: pow($)} -<===> operation/math/max/output.css -a { - b: 81; -} +<===> error/syntax/invalid_arg/error +Error: Expected identifier. + , +1 | a {b: pow($)} + | ^ + ' + input.scss 1:12 root stylesheet <===> ================================================================================ -<===> operation/math/min/input.scss -a {b: pow(min(2, 9), 5)} +<===> error/base_type/input.scss +a {b: mod(0, "0")} -<===> operation/math/min/output.css -a { - b: 32; -} +<===> error/base_type/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: mod(0, "0")} + | ^ + ' + input.scss 1:14 root stylesheet <===> ================================================================================ -<===> preserved/unknown_units/input.scss -a { - b: pow(1foo, 2bar); -} +<===> error/exponent_type/input.scss +a {b: mod("0", 0)} -<===> preserved/unknown_units/error -Error: Expected 1foo to have no units. +<===> error/exponent_type/error +Error: Expected number, variable, function, or calculation. , -2 | b: pow(1foo, 2bar); - | ^^^^^^^^^^^^^^^ +1 | a {b: mod("0", 0)} + | ^ ' - input.scss 2:6 root stylesheet + input.scss 1:11 root stylesheet <===> ================================================================================ -<===> preserved/variable/input.scss -a { - --two-args: 2, 3; - b: pow(var(--two-args)); -} +<===> error/no_arg/input.scss +a {b: pow()} -<===> preserved/variable/output.css -a { - --two-args: 2, 3; - b: pow(var(--two-args)); -} +<===> error/no_arg/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: pow()} + | ^ + ' + input.scss 1:11 root stylesheet <===> ================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: pow(test); -} +<===> error/one_arg/input.scss +a {b: pow(3)} -<===> preserved/unquoted_string/output.css -a { - b: pow(test); -} +<===> error/one_arg/error +Error: 2 arguments required, but only 1 was passed. + , +1 | a {b: pow(3)} + | ^^^^^^ + ' + input.scss 1:7 root stylesheet <===> ================================================================================ -<===> preserved/percent/input.scss -a {b: pow(4px, 3px - 1.5px + 5%)} +<===> error/too_many_args/input.scss +a {b: pow(3, 2, 1)} -<===> preserved/percent/output.css -a { - b: pow(4px, 1.5px + 5%); -} +<===> error/too_many_args/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: pow(3, 2, 1)} + | ^ + ' + input.scss 1:15 root stylesheet <===> ================================================================================ -<===> preserved/operation/variable/input.scss -a { - --test: 5; - b: pow(3px - 1px + var(--test), 4px); -} +<===> error/named_argument/input.scss +a {b: pow($number: 3)} -<===> preserved/operation/variable/output.css -a { - --test: 5; - b: pow(2px + var(--test), 4px); -} +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", ",", or ")". + , +1 | a {b: pow($number: 3)} + | ^ + ' + input.scss 1:18 root stylesheet diff --git a/spec/values/calculation/rem.hrx b/spec/values/calculation/rem.hrx index 6d7838802..d247f9372 100644 --- a/spec/values/calculation/rem.hrx +++ b/spec/values/calculation/rem.hrx @@ -2,152 +2,6 @@ Most of the same behavior tested for `calc()` applies to `rem()`, but for terseness' sake isn't tested explicitly. -<===> -================================================================================ -<===> error/syntax/no_arg/input.scss -a {b: rem()} - -<===> error/syntax/no_arg/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: rem()} - | ^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/missing_arg/input.scss -a {b: rem(3)} - -<===> error/syntax/missing_arg/error -Error: 2 arguments required, but only 1 was passed. - , -1 | a {b: rem(3)} - | ^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/syntax/many_args/input.scss -a {b: rem(3, 2, 1)} - -<===> error/syntax/many_args/error -Error: expected "+", "-", "*", "/", or ")". - , -1 | a {b: rem(3, 2, 1)} - | ^ - ' - input.scss 1:15 root stylesheet - -<===> -================================================================================ -<===> error/syntax/incompatible/input.scss -a {b: rem(16px, 5)} - -<===> error/syntax/incompatible/error -Error: 16px and 5 are incompatible. - , -1 | a {b: rem(16px, 5)} - | ^^^^ 16px - | = 5 - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/operation_incompatible/input.scss -a {b: rem(1 + 16px, 2)} - -<===> error/syntax/operation_incompatible/error -Error: 1 and 16px are incompatible. - , -1 | a {b: rem(1 + 16px, 2)} - | ^^^^^^^^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/min_incompatible/input.scss -a {b: rem(min(16, 9px), 6)} - -<===> error/syntax/min_incompatible/error -Error: 9px and 6 are incompatible. - , -1 | a {b: rem(min(16, 9px), 6)} - | ^^^^^^^^^^^^ 9px - | = 6 - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/invalid_arg/input.scss -a {b: rem($)} - -<===> error/syntax/invalid_arg/error -Error: Expected identifier. - , -1 | a {b: rem($)} - | ^ - ' - input.scss 1:12 root stylesheet - -<===> -================================================================================ -<===> error/syntax/quoted_string/input.scss -a {b: rem("test")} - -<===> error/syntax/quoted_string/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: rem("test")} - | ^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/syntax/one_arg/input.scss -a {b: rem(4)} - -<===> error/syntax/one_arg/error -Error: 2 arguments required, but only 1 was passed. - , -1 | a {b: rem(4)} - | ^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> error/complex_unit/input.scss -a {b: rem(1px*1px, 2)} - -<===> error/complex_unit/error -Error: Number 1px*px isn't compatible with CSS calculations. - , -1 | a {b: rem(1px*1px, 2)} - | ^^^^^^^ - ' - input.scss 1:11 root stylesheet - -<===> -================================================================================ -<===> error/incompatible_units/input.scss -a {b: rem(7em, -3deg)} - -<===> error/incompatible_units/error -Error: 7em and -3deg are incompatible. - , -1 | a {b: rem(7em, -3deg)} - | ^^^ 7em - | ===== -3deg - ' - input.scss 1:11 root stylesheet - <===> ================================================================================ <===> percentage/unit/input.scss @@ -160,115 +14,118 @@ a { <===> ================================================================================ -<===> unitless/positive_args/input.scss +<===> unitless/input.scss a {b: rem(7, 3)} -<===> unitless/positive_args/output.css +<===> unitless/output.css a { b: 1; } <===> ================================================================================ -<===> unitless/y_negative/input.scss +<===> units/input.scss a {b: rem(7px, -3px)} -<===> unitless/y_negative/output.css +<===> units/output.css a { b: -9px; } <===> ================================================================================ -<===> unitless/x_negative/input.scss -a {b: rem(-7, 3)} +<===> y_zero/input.scss +a {b: rem(6, 0)} -<===> unitless/x_negative/output.css +<===> y_zero/output.css a { - b: 9; + b: calc(NaN); } <===> ================================================================================ -<===> unitless/negative_args/input.scss -a {b: rem(-7, -3)} +<===> x_zero/input.scss +a {b: rem(0, 6)} -<===> unitless/negative_args/output.css +<===> x_zero/output.css a { - b: -1; + b: 0; } <===> ================================================================================ -<===> negative_zero/input.scss -@use "sass:math"; -a {b: math.div(1, rem(-7, 7))} +<===> operation/y_infinity/positive/input.scss +a {b: rem(infinity, 10)} -<===> negative_zero/output.css +<===> operation/y_infinity/positive/output.css a { - b: calc(-infinity); + b: calc(NaN); } <===> ================================================================================ -<===> preserved/unknown_units/input.scss +<===> operation/x_infinity/positive/input.scss +a {b: rem(-10, infinity)} + +<===> operation/x_infinity/positive/output.css a { - b: rem(1foo, 2bar); + b: -10; } -<===> preserved/unknown_units/output.css +<===> +================================================================================ +<===> operation/x_infinity/negative/input.scss +a {b: rem(10, -infinity)} + +<===> operation/x_infinity/negative/output.css a { - b: rem(1foo, 2bar); + b: 10; } <===> ================================================================================ -<===> preserved/variable/input.scss +<===> operation/simplification/input.scss a { - --two-args: 2, 3; - b: rem(var(--two-args)); + b: rem(3px - 1px + var(--c), 4px + 10px); } -<===> preserved/variable/output.css +<===> operation/simplification/output.css a { - --two-args: 2, 3; - b: rem(var(--two-args)); + b: rem(2px + var(--c), 14px); } <===> ================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: rem(test); -} +<===> preserved/percentage/input.scss +a {b: rem(4px + 3%, 3px - 1.5px + 5%)} -<===> preserved/unquoted_string/output.css +<===> preserved/percentage/output.css a { - b: rem(test); + b: rem(4px + 3%, 1.5px + 5%); } <===> ================================================================================ -<===> preserved/percent/input.scss -a {b: rem(4px, 3px - 1.5px + 5%)} +<===> preserved/variable/input.scss +a { + b: rem(var(--c)); +} -<===> preserved/percent/output.css +<===> preserved/variable/output.css a { - b: rem(4px, 1.5px + 5%); + b: rem(var(--c)); } <===> ================================================================================ -<===> preserved/operation/variable/input.scss +<===> preserved/unknown_units/input.scss a { - --test: 5; - b: rem(3px - 1px + var(--test), 4px); + b: rem(1foo, 2bar); } -<===> preserved/operation/variable/output.css +<===> preserved/unknown_units/output.css a { - --test: 5; - b: rem(2px + var(--test), 4px); + b: rem(1foo, 2bar); } <===> @@ -284,51 +141,139 @@ a { <===> ================================================================================ -<===> y_zero/plus/input.scss -a {b: rem(6, 0)} +<===> negative_zero/input.scss +@use "sass:math"; +a {b: math.div(1, rem(-7, 7))} -<===> y_zero/plus/output.css +<===> negative_zero/output.css a { - b: calc(NaN); + b: calc(-infinity); } <===> ================================================================================ -<===> x_zero/plus/input.scss -a {b: rem(0, 6)} +<===> zeros/input.scss +a {b: rem(0, 0)} -<===> x_zero/plus/output.css +<===> zeros/output.css a { - b: 0; + b: calc(NaN); } <===> ================================================================================ -<===> zeros/plus/input.scss -a {b: rem(0, 0)} +<===> error/variables/input.scss +a {b: rem($dividend: 1, $modulus: -1)} -<===> zeros/plus/output.css -a { - b: calc(NaN); -} +<===> error/variables/error +Error: expected "+", "-", "*", "/", ",", or ")". + , +1 | a {b: rem($dividend: 1, $modulus: -1)} + | ^ + ' + input.scss 1:20 root stylesheet <===> ================================================================================ -<===> y_infinity/plus/input.scss -@use "sass:math"; -a {b: rem(math.div(1, 0), 10)} +<===> error/incompatible_units/input.scss +a {b: rem(16px, 5)} -<===> y_infinity/plus/output.css -a { - b: calc(NaN); -} +<===> error/incompatible_units/error +Error: 16px and 5 are incompatible. + , +1 | a {b: rem(16px, 5)} + | ^^^^ 16px + | = 5 + ' + input.scss 1:11 root stylesheet <===> ================================================================================ -<===> x_infinity/plus/input.scss -a {b: rem(10, infinity)} +<===> error/syntax/missing_arg/input.scss +a {b: rem(3)} -<===> x_infinity/plus/output.css -a { - b: 10; -} +<===> error/syntax/missing_arg/error +Error: 2 arguments required, but only 1 was passed. + , +1 | a {b: rem(3)} + | ^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/syntax/invalid_arg/input.scss +a {b: rem($)} + +<===> error/syntax/invalid_arg/error +Error: Expected identifier. + , +1 | a {b: rem($)} + | ^ + ' + input.scss 1:12 root stylesheet + +<===> +================================================================================ +<===> error/modulus_type/input.scss +a {b: rem(0, "0")} + +<===> error/modulus_type/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: rem(0, "0")} + | ^ + ' + input.scss 1:14 root stylesheet + +<===> +================================================================================ +<===> error/dividend_type/input.scss +a {b: rem("0", 0)} + +<===> error/dividend_type/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: rem("0", 0)} + | ^ + ' + input.scss 1:11 root stylesheet + +<===> +================================================================================ +<===> error/no_arg/input.scss +a {b: rem()} + +<===> error/no_arg/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: rem()} + | ^ + ' + input.scss 1:11 root stylesheet + +<===> +================================================================================ +<===> error/too_many_args/input.scss +a {b: rem(3, 2, 1)} + +<===> error/too_many_args/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: rem(3, 2, 1)} + | ^ + ' + input.scss 1:15 root stylesheet + +<===> +================================================================================ +<===> error/named_argument/input.scss +a {b: rem($number: 3)} + +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", ",", or ")". + , +1 | a {b: rem($number: 3)} + | ^ + ' + input.scss 1:18 root stylesheet diff --git a/spec/values/calculation/round/one_argument.hrx b/spec/values/calculation/round/one_argument.hrx index 216d57930..2680f74d0 100644 --- a/spec/values/calculation/round/one_argument.hrx +++ b/spec/values/calculation/round/one_argument.hrx @@ -1,58 +1,67 @@ <===> README.md -Most of the same behavior tested for `calc()` applies to single-argument -`round()`, but for terseness' sake isn't tested explicitly. +Most of the same behavior tested for `calc()` applies to `round()`, but for +terseness' sake isn't tested explicitly. <===> ================================================================================ -<===> preserved/unquoted_string/input.scss -a {b: round(test)} +<===> zero/input.scss +a {b: round(0)} -<===> preserved/unquoted_string/output.css +<===> zero/output.css a { - b: round(test); + b: 0; } <===> ================================================================================ -<===> operation/math_simplify/input.scss -a {b: round(3.8px + 4px)} +<===> positive/input.scss +a {b: round(1)} -<===> operation/math_simplify/output.css +<===> positive/output.css a { - b: 8px; + b: 1; } <===> ================================================================================ -<===> unitless/input.scss -a {b: round(5.5)} +<===> negative/input.scss +a {b: round(-5.6)} -<===> unitless/output.css +<===> negative/output.css a { - b: 6; + b: -6; } <===> ================================================================================ -<===> variable/named_arg/input.scss -c {d: round($number: 12.1)} +<===> operation/preserves_units/input.scss +a {b: round(-7px / 4em) * 1em} -<===> variable/named_arg/output.css -c { - d: 12; +<===> operation/preserves_units/output.css +a { + b: -2px; } <===> ================================================================================ -<===> unknown_variable/input.scss +<===> preserved/variable/input.scss a { - --example: 5; - b: round(var(--example)); + b: round(var(--c)) } -<===> unknown_variable/output.css + +<===> preserved/variable/output.css a { - --example: 5; - b: round(var(--example)); + b: round(var(--c)); +} + +<===> +================================================================================ +<===> named_argument/input.scss +a {b: round($number: -3)} + +<===> named_argument/output.css +a { + b: -3; } <===> @@ -91,25 +100,64 @@ More info and automated migrator: https://sass-lang.com/d/slash-div <===> ================================================================================ -<===> math/max/input.scss +<===> error/named_argument/variable/input.scss +a {b: round($number: var(--c))} + +<===> error/named_argument/variable/error +Error: $number: var(--c) is not a number. + , +1 | a {b: round($number: var(--c))} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/unsimplifiable/input.scss +a {b: round(17px + 5%)} + +<===> error/unsimplifiable/error +Error: Single argument 17px + 5% expected to be simplifiable. + , +1 | a {b: round(17px + 5%)} + | ^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/variables/input.scss a { - e: round(max(1px, 1%)); + b: round(1px + 2px - var(--c)) } -<===> math/max/error -Error: Single argument max(1px, 1%) expected to be simplifiable. +<===> error/variables/error +Error: Single argument 3px - var(--c) expected to be simplifiable. , -2 | e: round(max(1px, 1%)); - | ^^^^^^^^^^^^^^^^^^^ +2 | b: round(1px + 2px - var(--c)) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 2:6 root stylesheet <===> ================================================================================ -<===> error/syntax/no_arg/input.scss +<===> error/type/input.scss +a {b: round("0")} + +<===> error/type/error +Error: $number: "0" is not a number. + , +1 | a {b: round("0")} + | ^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> error/no_args/input.scss a {b: round()} -<===> error/syntax/no_arg/error +<===> error/no_args/error Error: Missing argument $number. ,--> input.scss 1 | a {b: round()} @@ -123,46 +171,30 @@ Error: Missing argument $number. <===> ================================================================================ -<===> error/one_arg/missing_args/input.scss -a { - c: round(up); -} +<===> error/too_many_args/input.scss +a {b: round(1, 2, 3, 4)} -<===> error/one_arg/missing_args/error -Error: Number to round and step arguments are required. - , -2 | c: round(up); - | ^^^^^^^^^ +<===> error/too_many_args/error +Error: Only 1 argument allowed, but 4 were passed. + ,--> input.scss +1 | a {b: round(1, 2, 3, 4)} + | ^^^^^^^^^^^^^^^^^ invocation ' - input.scss 2:6 root stylesheet - -<===> -================================================================================ -<===> error/one_arg/unsimplified/input.scss -a { - c: round(1px + 10%); -} - -<===> error/one_arg/unsimplified/error -Error: Single argument 1px + 10% expected to be simplifiable. - , -2 | c: round(1px + 10%); - | ^^^^^^^^^^^^^^^^ + ,--> sass:math +1 | @function round($number) { + | ============== declaration ' - input.scss 2:6 root stylesheet + input.scss 1:7 root stylesheet <===> ================================================================================ -<===> error/math/variable/input.scss -a { - --example: 5; - b: round(3.8px + var(--example)); -} +<===> error/syntax/invalid_arg/input.scss +a {b: round($)} -<===> error/math/variable/error -Error: Single argument 3.8px + var(--example) expected to be simplifiable. +<===> error/syntax/invalid_arg/error +Error: Expected identifier. , -3 | b: round(3.8px + var(--example)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1 | a {b: round($)} + | ^ ' - input.scss 3:6 root stylesheet + input.scss 1:14 root stylesheet diff --git a/spec/values/calculation/round/three_arguments.hrx b/spec/values/calculation/round/three_arguments.hrx index 8c103bc77..07069ea3f 100644 --- a/spec/values/calculation/round/three_arguments.hrx +++ b/spec/values/calculation/round/three_arguments.hrx @@ -6,12 +6,10 @@ terseness' sake isn't tested explicitly. ================================================================================ <===> preserved/operation/nearest/math/input.scss a { - --test: 3; b: round(nearest, 3.8px - 1px + var(--test), 1.1px + 4px)} <===> preserved/operation/nearest/math/output.css a { - --test: 3; b: round(nearest, 2.8px + var(--test), 5.1px); } @@ -147,22 +145,22 @@ a { ================================================================================ <===> unknown_variable/first_arg/input.scss a { - e: round(var(--example), 8px, 9px); + e: round(var(--c), 8px, 9px); } <===> unknown_variable/first_arg/output.css a { - e: round(var(--example), 8px, 9px); + e: round(var(--c), 8px, 9px); } <===> ================================================================================ <===> unknown_variable/third_arg/input.scss a { - d: round(up, 8px, var(--example)); + d: round(up, 8px, var(--c)); } <===> unknown_variable/third_arg/output.css a { - d: round(up, 8px, var(--example)); + d: round(up, 8px, var(--c)); } <===> diff --git a/spec/values/calculation/round/two_arguments.hrx b/spec/values/calculation/round/two_arguments.hrx index c59ef793b..6023b66b4 100644 --- a/spec/values/calculation/round/two_arguments.hrx +++ b/spec/values/calculation/round/two_arguments.hrx @@ -131,12 +131,12 @@ a { ================================================================================ <===> error/unknown_variable/number/input.scss a { - c: round(up, var(--example)); + c: round(up, var(--c)); } <===> error/unknown_variable/number/output.css a { - c: round(up, var(--example)); + c: round(up, var(--c)); } <===> diff --git a/spec/values/calculation/sign.hrx b/spec/values/calculation/sign.hrx index 0ae6039f4..1fc832ced 100644 --- a/spec/values/calculation/sign.hrx +++ b/spec/values/calculation/sign.hrx @@ -4,172 +4,149 @@ terseness' sake isn't tested explicitly. <===> ================================================================================ -<===> error/syntax/no_arg/input.scss -a {b: sign()} - -<===> error/syntax/no_arg/error -Error: Expected number, variable, function, or calculation. - , -1 | a {b: sign()} - | ^ - ' - input.scss 1:12 root stylesheet - -<===> -================================================================================ -<===> error/syntax/many_args/input.scss -a {b: sign(3, 2)} +<===> positive/input.scss +a {b: sign(3)} -<===> error/syntax/many_args/error -Error: expected "+", "-", "*", "/", or ")". - , -1 | a {b: sign(3, 2)} - | ^ - ' - input.scss 1:13 root stylesheet +<===> positive/output.css +a { + b: 1; +} <===> ================================================================================ -<===> error/syntax/operation_incompatible/input.scss -a {b: sign(1 + 16px)} +<===> negative/input.scss +a {b: sign(-5.6)} -<===> error/syntax/operation_incompatible/error -Error: 1 and 16px are incompatible. - , -1 | a {b: sign(1 + 16px)} - | ^^^^^^^^ - ' - input.scss 1:12 root stylesheet +<===> negative/output.css +a { + b: -1; +} <===> ================================================================================ -<===> error/syntax/invalid_arg/input.scss -a {b: sign($)} +<===> zero/input.scss +a {b: sign(0)} -<===> error/syntax/invalid_arg/error -Error: Expected identifier. - , -1 | a {b: sign($)} - | ^ - ' - input.scss 1:13 root stylesheet +<===> zero/output.css +a { + b: 0; +} <===> ================================================================================ -<===> error/complex_unit/input.scss -a {b: sign(1px*1px)} +<===> zero_fuzzy/input.scss +a {b: sign(0.000000000001)} -<===> error/complex_unit/output.css +<===> zero_fuzzy/output.css a { b: 1; } <===> ================================================================================ -<===> error/unit/input.scss -a {b: sign(5%)} +<===> operation/preserves_units/input.scss +a {b: sign(-7px / 4em) * 1em} -<===> error/unit/output.css +<===> operation/preserves_units/output.css a { - b: sign(5%); + b: -1em; } <===> ================================================================================ -<===> operation/unit/positive/input.scss -a {b: sign(5px)} - -<===> operation/unit/positive/output.css +<===> operation/simplification/input.scss a { - b: 1; + b: sign(1px + 2px - var(--c)) } -<===> -================================================================================ -<===> operation/unitless/negative/input.scss -a {b: sign(-1000.65)} - -<===> operation/unitless/negative/output.css +<===> operation/simplification/output.css a { - b: -1; + b: sign(3px - var(--c)); } <===> ================================================================================ -<===> operation/zero/positive/input.scss -a {b: sign(0px)} +<===> preserved/variable/input.scss +a { + b: sign(var(--c)) +} -<===> operation/zero/positive/output.css +<===> preserved/variable/output.css a { - b: 0; + b: sign(var(--c)); } <===> ================================================================================ -<===> operation/zero/negative/input.scss -a {b: sign(-0)} +<===> preserved/operation/percentage/input.scss +a {b: sign(17px + 5%)} -<===> operation/zero/negative/output.css +<===> preserved/operation/percentage/output.css a { - b: 0; + b: sign(17px + 5%); } <===> ================================================================================ -<===> operation/nan/input.scss -a {b: sign(NaN)} +<===> error/type/input.scss +a {b: sign("0")} -<===> operation/nan/output.css -a { - b: calc(NaN); -} +<===> error/type/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: sign("0")} + | ^ + ' + input.scss 1:12 root stylesheet <===> ================================================================================ -<===> preserved/variable/input.scss -a { - --one-arg: 2; - b: sign(var(--one-arg)); -} +<===> error/zero_args/input.scss +a {b: sign()} -<===> preserved/variable/output.css -a { - --one-arg: 2; - b: sign(var(--one-arg)); -} +<===> error/zero_args/error +Error: Expected number, variable, function, or calculation. + , +1 | a {b: sign()} + | ^ + ' + input.scss 1:12 root stylesheet <===> ================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: sign(test); -} +<===> error/too_many_args/input.scss +a {b: sign(0, 0)} -<===> preserved/unquoted_string/output.css -a { - b: sign(test); -} +<===> error/too_many_args/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: sign(0, 0)} + | ^ + ' + input.scss 1:13 root stylesheet <===> ================================================================================ -<===> preserved/percent/input.scss -a {b: sign(3px - 1.5px + 5%)} +<===> error/syntax/invalid_arg/input.scss +a {b: sign($)} -<===> preserved/percent/output.css -a { - b: sign(1.5px + 5%); -} +<===> error/syntax/invalid_arg/error +Error: Expected identifier. + , +1 | a {b: sign($)} + | ^ + ' + input.scss 1:13 root stylesheet <===> ================================================================================ -<===> preserved/operation/variable/input.scss -a { - --test: 5; - b: sign(3px - 1px + var(--test)); -} +<===> error/named_argument/input.scss +a {b: sign($number: 3)} -<===> preserved/operation/variable/output.css -a { - --test: 5; - b: sign(2px + var(--test)); -} +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: sign($number: 3)} + | ^ + ' + input.scss 1:19 root stylesheet diff --git a/spec/values/calculation/sin.hrx b/spec/values/calculation/sin.hrx index 7a45ae5d7..d7374c18c 100644 --- a/spec/values/calculation/sin.hrx +++ b/spec/values/calculation/sin.hrx @@ -2,28 +2,6 @@ Most of the same behavior tested for `calc()` applies to `sin()`, but for terseness' sake isn't tested explicitly. -<===> -================================================================================ -<===> negative_infinity/input.scss -@use "sass:math"; -a {b: sin(math.div(-1, 0))} - -<===> negative_infinity/output.css -a { - b: calc(NaN); -} - -<===> -================================================================================ -<===> infinity/input.scss -@use "sass:math"; -a {b: sin(math.div(1, 0))} - -<===> infinity/output.css -a { - b: calc(NaN); -} - <===> ================================================================================ <===> deg/input.scss @@ -64,6 +42,17 @@ a { b: 0; } +<===> +================================================================================ +<===> negative_infinity/input.scss +@use "sass:math"; +a {b: sin(math.div(-1, 0))} + +<===> negative_infinity/output.css +a { + b: calc(NaN); +} + <===> ================================================================================ <===> less_than_negative_one/input.scss @@ -76,30 +65,40 @@ a { <===> ================================================================================ -<===> negative_decimal/input.scss -a {b: sin(-0.5)} +<===> negative_one/input.scss +a {b: sin(-1)} + +<===> negative_one/output.css +a { + b: -0.8414709848; +} + +<===> +================================================================================ +<===> zero/input.scss +a {b: sin(0)} -<===> negative_decimal/output.css +<===> zero/output.css a { - b: -0.4794255386; + b: 0; } <===> ================================================================================ -<===> decimal/input.scss -a {b: sin(0.5)} +<===> zero_fuzzy/input.scss +a {b: sin(0.000000000001)} -<===> decimal/output.css +<===> zero_fuzzy/output.css a { - b: 0.4794255386; + b: 0; } <===> ================================================================================ -<===> unitless/input.scss +<===> one/input.scss a {b: sin(1)} -<===> unitless/output.css +<===> one/output.css a { b: 0.8414709848; } @@ -124,6 +123,17 @@ a { b: 0.9092974268; } +<===> +================================================================================ +<===> infinity/input.scss +@use "sass:math"; +a {b: sin(math.div(1, 0))} + +<===> infinity/output.css +a { + b: calc(NaN); +} + <===> ================================================================================ <===> preserved/percent/input.scss @@ -138,40 +148,24 @@ a { ================================================================================ <===> preserved/operation/variable/input.scss a { - --test: 5; - b: sin(3px - 1px + var(--test)); + b: sin(3px - 1px + var(--c)); } <===> preserved/operation/variable/output.css a { - --test: 5; - b: sin(2px + var(--test)); + b: sin(2px + var(--c)); } <===> ================================================================================ <===> preserved/variable/input.scss a { - --test: 5; - b: sin(var(--test)); + b: sin(var(--c)); } <===> preserved/variable/output.css a { - --test: 5; - b: sin(var(--test)); -} - -<===> -================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: sin(test); -} - -<===> preserved/unquoted_string/output.css -a { - b: sin(test); + b: sin(var(--c)); } <===> @@ -241,13 +235,13 @@ Error: Expected identifier. <===> ================================================================================ -<===> percent/input.scss -a {b: sin(1%)} +<===> error/named_argument/input.scss +a {b: sin($number: 3)} -<===> percent/error -Error: $number: Expected 1% to have an angle unit (deg, grad, rad, turn). +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". , -1 | a {b: sin(1%)} - | ^^^^^^^ +1 | a {b: sin($number: 3)} + | ^ ' - input.scss 1:7 root stylesheet + input.scss 1:18 root stylesheet diff --git a/spec/values/calculation/sqrt.hrx b/spec/values/calculation/sqrt.hrx index 2b05ea81a..ae5144316 100644 --- a/spec/values/calculation/sqrt.hrx +++ b/spec/values/calculation/sqrt.hrx @@ -4,130 +4,78 @@ terseness' sake isn't tested explicitly. <===> ================================================================================ -<===> operation/unitless/result_is_integer/input.scss +<===> zero/input.scss +a {b: sqrt(0)} + +<===> zero/output.css +a { + b: 0; +} + +<===> +================================================================================ +<===> unitless/result_is_integer/input.scss a {b: sqrt(16)} -<===> operation/unitless/result_is_integer/output.css +<===> unitless/result_is_integer/output.css a { b: 4; } <===> ================================================================================ -<===> operation/unitless/result_is_float/input.scss +<===> unitless/result_is_float/input.scss a {b: sqrt(2)} -<===> operation/unitless/result_is_float/output.css +<===> unitless/result_is_float/output.css a { b: 1.4142135624; } <===> ================================================================================ -<===> operation/unitless/negative/input.scss +<===> unitless/negative/input.scss a {b: sqrt(-9)} -<===> operation/unitless/negative/output.css +<===> unitless/negative/output.css a { b: calc(NaN); } <===> ================================================================================ -<===> operation/math/plus/input.scss -a {b: sqrt(10 + 6)} - -<===> operation/math/plus/output.css +<===> operation/simplification/input.scss a { - b: 4; + b: sqrt(1px + 2px - var(--c)) } -<===> -================================================================================ -<===> operation/nested_function/input.scss -a {b: sqrt(max(2, 9))} - -<===> operation/nested_function/output.css +<===> operation/simplification/output.css a { - b: 3; + b: sqrt(3px - var(--c)); } <===> ================================================================================ -<===> operation/percent/input.scss +<===> preserved/operation/percentage/input.scss a {b: sqrt(3px - 1.5px + 5%)} -<===> operation/percent/output.css +<===> preserved/operation/percentage/output.css a { b: sqrt(1.5px + 5%); } -<===> -================================================================================ -<===> preserved/operation/variable/input.scss -a { - --test: 5; - b: sqrt(3px - 1px + var(--test)); -} - -<===> preserved/operation/variable/output.css -a { - --test: 5; - b: sqrt(2px + var(--test)); -} - <===> ================================================================================ <===> preserved/variable/input.scss a { - --test: 5; - b: sqrt(var(--test)); + b: sqrt(var(--c)); } <===> preserved/variable/output.css a { - --test: 5; - b: sqrt(var(--test)); -} - -<===> -================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: sqrt(test); -} - -<===> preserved/unquoted_string/output.css -a { - b: sqrt(test); + b: sqrt(var(--c)); } -<===> -================================================================================ -<===> error/variables/input.scss -a {b: sqrt($base: 1, $exponent: -1)} - -<===> error/variables/error -Error: expected "+", "-", "*", "/", or ")". - , -1 | a {b: sqrt($base: 1, $exponent: -1)} - | ^ - ' - input.scss 1:17 root stylesheet - -<===> -================================================================================ -<===> error/percentage/input.scss -a {b: calc(sqrt(5%))} - -<===> error/percentage/error -Error: Expected 5% to have no units. - , -1 | a {b: calc(sqrt(5%))} - | ^^^^^^^^ - ' - input.scss 1:12 root stylesheet - <===> ================================================================================ <===> error/units/input.scss @@ -143,27 +91,14 @@ Error: Expected 16px to have no units. <===> ================================================================================ -<===> error/nested_function/units/input.scss -a {b: calc(sqrt(min(16, 9px)))} - -<===> error/nested_function/units/error -Error: Expected 9px to have no units. - , -1 | a {b: calc(sqrt(min(16, 9px)))} - | ^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:12 root stylesheet - -<===> -================================================================================ -<===> error/operation/incompatible_units/input.scss -a {b: sqrt(1 + 16px)} +<===> error/type/input.scss +a {b: sqrt("0")} -<===> error/operation/incompatible_units/error -Error: 1 and 16px are incompatible. +<===> error/type/error +Error: Expected number, variable, function, or calculation. , -1 | a {b: sqrt(1 + 16px)} - | ^^^^^^^^ +1 | a {b: sqrt("0")} + | ^ ' input.scss 1:12 root stylesheet @@ -182,27 +117,39 @@ Error: Expected number, variable, function, or calculation. <===> ================================================================================ -<===> error/syntax/many_args/input.scss -a {b: sqrt(3, 4)} +<===> error/syntax/invalid_arg/input.scss +a {b: sqrt($)} -<===> error/syntax/many_args/error -Error: expected "+", "-", "*", "/", or ")". +<===> error/syntax/invalid_arg/error +Error: Expected identifier. , -1 | a {b: sqrt(3, 4)} +1 | a {b: sqrt($)} | ^ ' input.scss 1:13 root stylesheet <===> ================================================================================ -<===> error/syntax/invalid_arg/input.scss -a {b: sqrt($)} +<===> error/too_many_args/input.scss +a {b: sqrt(3, 4)} -<===> error/syntax/invalid_arg/error -Error: Expected identifier. +<===> error/too_many_args/error +Error: expected "+", "-", "*", "/", or ")". , -1 | a {b: sqrt($)} +1 | a {b: sqrt(3, 4)} | ^ ' input.scss 1:13 root stylesheet +<===> +================================================================================ +<===> error/named_argument/input.scss +a {b: sqrt($number: 3)} + +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". + , +1 | a {b: sqrt($number: 3)} + | ^ + ' + input.scss 1:19 root stylesheet diff --git a/spec/values/calculation/tan.hrx b/spec/values/calculation/tan.hrx index 305f948c5..9b7ae45a7 100644 --- a/spec/values/calculation/tan.hrx +++ b/spec/values/calculation/tan.hrx @@ -2,28 +2,6 @@ Most of the same behavior tested for `calc()` applies to `tan()`, but for terseness' sake isn't tested explicitly. -<===> -================================================================================ -<===> negative_infinity/input.scss -@use "sass:math"; -a {b: tan(math.div(-1, 0))} - -<===> negative_infinity/output.css -a { - b: calc(NaN); -} - -<===> -================================================================================ -<===> infinity/input.scss -@use "sass:math"; -a {b: tan(math.div(1, 0))} - -<===> infinity/output.css -a { - b: calc(NaN); -} - <===> ================================================================================ <===> deg/input.scss @@ -64,6 +42,17 @@ a { b: 0; } +<===> +================================================================================ +<===> negative_infinity/input.scss +@use "sass:math"; +a {b: tan(math.div(-1, 0))} + +<===> negative_infinity/output.css +a { + b: calc(NaN); +} + <===> ================================================================================ <===> less_than_negative_one/input.scss @@ -76,30 +65,40 @@ a { <===> ================================================================================ -<===> negative_decimal/input.scss -a {b: tan(-0.5)} +<===> negative_one/input.scss +a {b: tan(-1)} + +<===> negative_one/output.css +a { + b: -1.5574077247; +} + +<===> +================================================================================ +<===> zero/input.scss +a {b: tan(0)} -<===> negative_decimal/output.css +<===> zero/output.css a { - b: -0.5463024898; + b: 0; } <===> ================================================================================ -<===> decimal/input.scss -a {b: tan(0.5)} +<===> zero_fuzzy/input.scss +a {b: tan(0.000000000001)} -<===> decimal/output.css +<===> zero_fuzzy/output.css a { - b: 0.5463024898; + b: 0; } <===> ================================================================================ -<===> unitless/input.scss +<===> one/input.scss a {b: tan(1)} -<===> unitless/output.css +<===> one/output.css a { b: 1.5574077247; } @@ -124,6 +123,17 @@ a { b: -2.1850398633; } +<===> +================================================================================ +<===> infinity/input.scss +@use "sass:math"; +a {b: tan(math.div(1, 0))} + +<===> infinity/output.css +a { + b: calc(NaN); +} + <===> ================================================================================ <===> preserved/percent/input.scss @@ -138,40 +148,24 @@ a { ================================================================================ <===> preserved/operation/variable/input.scss a { - --test: 5; - b: tan(3px - 1px + var(--test)); + b: tan(3px - 1px + var(--c)); } <===> preserved/operation/variable/output.css a { - --test: 5; - b: tan(2px + var(--test)); + b: tan(2px + var(--c)); } <===> ================================================================================ <===> preserved/variable/input.scss a { - --test: 5; - b: tan(var(--test)); + b: tan(var(--c)); } <===> preserved/variable/output.css a { - --test: 5; - b: tan(var(--test)); -} - -<===> -================================================================================ -<===> preserved/unquoted_string/input.scss -a { - b: tan(test); -} - -<===> preserved/unquoted_string/output.css -a { - b: tan(test); + b: tan(var(--c)); } <===> @@ -229,25 +223,25 @@ Error: expected "+", "-", "*", "/", or ")". <===> ================================================================================ <===> error/syntax/invalid_arg/input.scss -a {b: tan($)} +a {b: sin($)} <===> error/syntax/invalid_arg/error Error: Expected identifier. , -1 | a {b: tan($)} +1 | a {b: sin($)} | ^ ' input.scss 1:12 root stylesheet <===> ================================================================================ -<===> percent/input.scss -a {b: tan(1%)} +<===> error/named_argument/input.scss +a {b: sin($number: 3)} -<===> percent/error -Error: $number: Expected 1% to have an angle unit (deg, grad, rad, turn). +<===> error/named_argument/error +Error: expected "+", "-", "*", "/", or ")". , -1 | a {b: tan(1%)} - | ^^^^^^^ +1 | a {b: sin($number: 3)} + | ^ ' - input.scss 1:7 root stylesheet + input.scss 1:18 root stylesheet