From 40aa2b3cce9544d4a8124f3fef1882981df37760 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Fri, 28 Oct 2022 13:07:29 -0700 Subject: [PATCH] Update tests for strict function unit deprecations (#1830) See #1813 See sass/sass#3374 --- .../color/adjust_color/error/bounds.hrx | 20 ++++- .../color/adjust_color/units.hrx | 72 ++++++++++++++- spec/core_functions/color/adjust_hue.hrx | 4 +- .../color/change_color/error/bounds.hrx | 20 ++++- .../color/change_color/units.hrx | 72 ++++++++++++++- .../color/hsl/one_arg/no_alpha.hrx | 4 + .../color/hsl/three_args/units.hrx | 16 +++- .../color/hwb/three_args/units.hrx | 4 +- spec/core_functions/color/invert.hrx | 70 +++++++++++++-- spec/core_functions/color/mix.hrx | 90 +++++++++++++------ spec/core_functions/list/nth.hrx | 27 ++++++ spec/core_functions/list/set_nth.hrx | 27 ++++++ spec/core_functions/math/random.hrx | 5 +- spec/libsass/test.hrx | 17 ++++ 14 files changed, 390 insertions(+), 58 deletions(-) diff --git a/spec/core_functions/color/adjust_color/error/bounds.hrx b/spec/core_functions/color/adjust_color/error/bounds.hrx index a14f9eb414..03e71f05b1 100644 --- a/spec/core_functions/color/adjust_color/error/bounds.hrx +++ b/spec/core_functions/color/adjust_color/error/bounds.hrx @@ -243,7 +243,9 @@ a {b: adjust-color(red, $saturation: 200px)} <===> saturation/unit/error DEPRECATION WARNING: $saturation: Passing a number without unit % (200px) is deprecated. -To preserve current behavior: $saturation / 1px * 1% +To preserve current behavior: calc($saturation / 1px * 1%) + +More info: https://sass-lang.com/d/function-units , 3 | a {b: adjust-color(red, $saturation: 200px)} @@ -318,7 +320,9 @@ a {b: adjust-color(red, $lightness: 200px)} <===> lightness/unit/error DEPRECATION WARNING: $lightness: Passing a number without unit % (200px) is deprecated. -To preserve current behavior: $lightness / 1px * 1% +To preserve current behavior: calc($lightness / 1px * 1%) + +More info: https://sass-lang.com/d/function-units , 3 | a {b: adjust-color(red, $lightness: 200px)} @@ -391,6 +395,18 @@ Error: argument `$alpha` of `adjust-color($color, $red: false, $green: false, $b a {b: adjust-color(red, $alpha: 50%)} <===> alpha/unit/error +DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. + +To preserve current behavior: calc($alpha / 1%) + +More info: https://sass-lang.com/d/function-units + + , +3 | a {b: adjust-color(red, $alpha: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + Error: $alpha: Expected 50% to be within -1 and 1. , 3 | a {b: adjust-color(red, $alpha: 50%)} diff --git a/spec/core_functions/color/adjust_color/units.hrx b/spec/core_functions/color/adjust_color/units.hrx index 1bfd1870d3..f4f70a0c08 100644 --- a/spec/core_functions/color/adjust_color/units.hrx +++ b/spec/core_functions/color/adjust_color/units.hrx @@ -36,7 +36,7 @@ a { <===> hue/unknown/warning DEPRECATION WARNING: $hue: Passing a unit other than deg (60in) is deprecated. -To preserve current behavior: $hue / 1in +To preserve current behavior: calc($hue / 1in) See https://sass-lang.com/d/color-units @@ -62,7 +62,7 @@ DEPRECATION WARNING: $hue: Passing a unit other than deg (60rad) is deprecated. You're passing 60rad, which is currently (incorrectly) converted to 60deg. Soon, it will instead be correctly converted to 3437.7467707849deg. -To preserve current behavior: $hue * 1deg/1rad +To preserve current behavior: calc($hue * 1deg/1rad) To migrate to new behavior: 0deg + $hue See https://sass-lang.com/d/color-units @@ -98,6 +98,8 @@ DEPRECATION WARNING: $saturation: Passing a number without unit % (-10) is depre To preserve current behavior: $saturation * 1% +More info: https://sass-lang.com/d/function-units + , 1 | a {b: adjust-color(red, $saturation: -10)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -117,7 +119,9 @@ a { <===> saturation/unknown/warning DEPRECATION WARNING: $saturation: Passing a number without unit % (-10in) is deprecated. -To preserve current behavior: $saturation / 1in * 1% +To preserve current behavior: calc($saturation / 1in * 1%) + +More info: https://sass-lang.com/d/function-units , 1 | a {b: adjust-color(red, $saturation: -10in)} @@ -150,6 +154,8 @@ DEPRECATION WARNING: $lightness: Passing a number without unit % (10) is depreca To preserve current behavior: $lightness * 1% +More info: https://sass-lang.com/d/function-units + , 1 | a {b: adjust-color(red, $lightness: 10)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -169,10 +175,68 @@ a { <===> lightness/unknown/warning DEPRECATION WARNING: $lightness: Passing a number without unit % (10in) is deprecated. -To preserve current behavior: $lightness / 1in * 1% +To preserve current behavior: calc($lightness / 1in * 1%) + +More info: https://sass-lang.com/d/function-units , 1 | a {b: adjust-color(red, $lightness: 10in)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/unitless/input.scss +a {b: adjust-color(red, $alpha: -0.3)} + +<===> alpha/unitless/output.css +a { + b: rgba(255, 0, 0, 0.7); +} + +<===> +================================================================================ +<===> alpha/percent/input.scss +a {b: adjust-color(red, $alpha: -0.3%)} + +<===> alpha/percent/output.css +a { + b: rgba(255, 0, 0, 0.7); +} + +<===> alpha/percent/warning +DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. + +To preserve current behavior: calc($alpha / 1%) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: adjust-color(red, $alpha: -0.3%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/unknown/input.scss +a {b: adjust-color(red, $alpha: -0.3px)} + +<===> alpha/unknown/output.css +a { + b: rgba(255, 0, 0, 0.7); +} + +<===> alpha/unknown/warning +DEPRECATION WARNING: $alpha: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($alpha / 1px) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: adjust-color(red, $alpha: -0.3px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/adjust_hue.hrx b/spec/core_functions/color/adjust_hue.hrx index 0bd7dc92c0..c19659cfec 100644 --- a/spec/core_functions/color/adjust_hue.hrx +++ b/spec/core_functions/color/adjust_hue.hrx @@ -116,7 +116,7 @@ a { <===> units/unknown/warning DEPRECATION WARNING: $degrees: Passing a unit other than deg (60in) is deprecated. -To preserve current behavior: $degrees / 1in +To preserve current behavior: calc($degrees / 1in) See https://sass-lang.com/d/color-units @@ -142,7 +142,7 @@ DEPRECATION WARNING: $degrees: Passing a unit other than deg (60rad) is deprecat You're passing 60rad, which is currently (incorrectly) converted to 60deg. Soon, it will instead be correctly converted to 3437.7467707849deg. -To preserve current behavior: $degrees * 1deg/1rad +To preserve current behavior: calc($degrees * 1deg/1rad) To migrate to new behavior: 0deg + $degrees See https://sass-lang.com/d/color-units diff --git a/spec/core_functions/color/change_color/error/bounds.hrx b/spec/core_functions/color/change_color/error/bounds.hrx index 86926108f3..ae90fcc5d0 100644 --- a/spec/core_functions/color/change_color/error/bounds.hrx +++ b/spec/core_functions/color/change_color/error/bounds.hrx @@ -243,7 +243,9 @@ a {b: change-color(red, $saturation: 200px)} <===> saturation/unit/error DEPRECATION WARNING: $saturation: Passing a number without unit % (200px) is deprecated. -To preserve current behavior: $saturation / 1px * 1% +To preserve current behavior: calc($saturation / 1px * 1%) + +More info: https://sass-lang.com/d/function-units , 3 | a {b: change-color(red, $saturation: 200px)} @@ -318,7 +320,9 @@ a {b: change-color(red, $lightness: 200px)} <===> lightness/unit/error DEPRECATION WARNING: $lightness: Passing a number without unit % (200px) is deprecated. -To preserve current behavior: $lightness / 1px * 1% +To preserve current behavior: calc($lightness / 1px * 1%) + +More info: https://sass-lang.com/d/function-units , 3 | a {b: change-color(red, $lightness: 200px)} @@ -391,6 +395,18 @@ Error: argument `$alpha` of `change-color($color, $red: false, $green: false, $b a {b: change-color(red, $alpha: 50%)} <===> alpha/unit/error +DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. + +To preserve current behavior: calc($alpha / 1%) + +More info: https://sass-lang.com/d/function-units + + , +3 | a {b: change-color(red, $alpha: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 3:7 root stylesheet + Error: $alpha: Expected 50% to be within 0 and 1. , 3 | a {b: change-color(red, $alpha: 50%)} diff --git a/spec/core_functions/color/change_color/units.hrx b/spec/core_functions/color/change_color/units.hrx index bf7992de27..87fb30e1ea 100644 --- a/spec/core_functions/color/change_color/units.hrx +++ b/spec/core_functions/color/change_color/units.hrx @@ -36,7 +36,7 @@ a { <===> hue/unknown/warning DEPRECATION WARNING: $hue: Passing a unit other than deg (60in) is deprecated. -To preserve current behavior: $hue / 1in +To preserve current behavior: calc($hue / 1in) See https://sass-lang.com/d/color-units @@ -62,7 +62,7 @@ DEPRECATION WARNING: $hue: Passing a unit other than deg (60rad) is deprecated. You're passing 60rad, which is currently (incorrectly) converted to 60deg. Soon, it will instead be correctly converted to 3437.7467707849deg. -To preserve current behavior: $hue * 1deg/1rad +To preserve current behavior: calc($hue * 1deg/1rad) To migrate to new behavior: 0deg + $hue See https://sass-lang.com/d/color-units @@ -98,6 +98,8 @@ DEPRECATION WARNING: $saturation: Passing a number without unit % (50) is deprec To preserve current behavior: $saturation * 1% +More info: https://sass-lang.com/d/function-units + , 1 | a {b: change-color(red, $saturation: 50)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -117,7 +119,9 @@ a { <===> saturation/unknown/warning DEPRECATION WARNING: $saturation: Passing a number without unit % (50in) is deprecated. -To preserve current behavior: $saturation / 1in * 1% +To preserve current behavior: calc($saturation / 1in * 1%) + +More info: https://sass-lang.com/d/function-units , 1 | a {b: change-color(red, $saturation: 50in)} @@ -150,6 +154,8 @@ DEPRECATION WARNING: $lightness: Passing a number without unit % (30) is depreca To preserve current behavior: $lightness * 1% +More info: https://sass-lang.com/d/function-units + , 1 | a {b: change-color(red, $lightness: 30)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -169,10 +175,68 @@ a { <===> lightness/unknown/warning DEPRECATION WARNING: $lightness: Passing a number without unit % (30in) is deprecated. -To preserve current behavior: $lightness / 1in * 1% +To preserve current behavior: calc($lightness / 1in * 1%) + +More info: https://sass-lang.com/d/function-units , 1 | a {b: change-color(red, $lightness: 30in)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/unitless/input.scss +a {b: change-color(red, $alpha: 0.5)} + +<===> alpha/unitless/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> alpha/percent/input.scss +a {b: adjust-color(red, $alpha: 0.5%)} + +<===> alpha/percent/output.css +a { + b: red; +} + +<===> alpha/percent/warning +DEPRECATION WARNING: $alpha: Passing a number with unit % is deprecated. + +To preserve current behavior: calc($alpha / 1%) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: adjust-color(red, $alpha: 0.5%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> alpha/unknown/input.scss +a {b: adjust-color(red, $alpha: 0.5px)} + +<===> alpha/unknown/output.css +a { + b: red; +} + +<===> alpha/unknown/warning +DEPRECATION WARNING: $alpha: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($alpha / 1px) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: adjust-color(red, $alpha: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/hsl/one_arg/no_alpha.hrx b/spec/core_functions/color/hsl/one_arg/no_alpha.hrx index a9fa07f3a4..73c938a984 100644 --- a/spec/core_functions/color/hsl/one_arg/no_alpha.hrx +++ b/spec/core_functions/color/hsl/one_arg/no_alpha.hrx @@ -91,6 +91,8 @@ DEPRECATION WARNING: $saturation: Passing a number without unit % (50) is deprec To preserve current behavior: $saturation * 1% +More info: https://sass-lang.com/d/function-units + , 1 | a {b: hsl(0 50 50%)} | ^^^^^^^^^^^^^ @@ -112,6 +114,8 @@ DEPRECATION WARNING: $lightness: Passing a number without unit % (50) is depreca To preserve current behavior: $lightness * 1% +More info: https://sass-lang.com/d/function-units + , 1 | a {b: hsl(0 100% 50)} | ^^^^^^^^^^^^^^ diff --git a/spec/core_functions/color/hsl/three_args/units.hrx b/spec/core_functions/color/hsl/three_args/units.hrx index 5fa4ff6dbd..eb576862ee 100644 --- a/spec/core_functions/color/hsl/three_args/units.hrx +++ b/spec/core_functions/color/hsl/three_args/units.hrx @@ -51,7 +51,7 @@ a { <===> hue/unknown/warning DEPRECATION WARNING: $hue: Passing a unit other than deg (60in) is deprecated. -To preserve current behavior: $hue / 1in +To preserve current behavior: calc($hue / 1in) See https://sass-lang.com/d/color-units @@ -84,7 +84,7 @@ DEPRECATION WARNING: $hue: Passing a unit other than deg (60rad) is deprecated. You're passing 60rad, which is currently (incorrectly) converted to 60deg. Soon, it will instead be correctly converted to 3437.7467707849deg. -To preserve current behavior: $hue * 1deg/1rad +To preserve current behavior: calc($hue * 1deg/1rad) To migrate to new behavior: 0deg + $hue See https://sass-lang.com/d/color-units @@ -117,6 +117,8 @@ DEPRECATION WARNING: $saturation: Passing a number without unit % (50) is deprec To preserve current behavior: $saturation * 1% +More info: https://sass-lang.com/d/function-units + , 1 | a {b: hsl(0, 50, 50%)} | ^^^^^^^^^^^^^^^ @@ -143,7 +145,9 @@ a { <===> saturation/unknown/warning DEPRECATION WARNING: $saturation: Passing a number without unit % (50in) is deprecated. -To preserve current behavior: $saturation / 1in * 1% +To preserve current behavior: calc($saturation / 1in * 1%) + +More info: https://sass-lang.com/d/function-units , 1 | a {b: hsl(0, 50in, 50%)} @@ -173,6 +177,8 @@ DEPRECATION WARNING: $lightness: Passing a number without unit % (50) is depreca To preserve current behavior: $lightness * 1% +More info: https://sass-lang.com/d/function-units + , 1 | a {b: hsl(0, 100%, 50)} | ^^^^^^^^^^^^^^^^ @@ -199,7 +205,9 @@ a { <===> lightness/unknown/warning DEPRECATION WARNING: $lightness: Passing a number without unit % (50in) is deprecated. -To preserve current behavior: $lightness / 1in * 1% +To preserve current behavior: calc($lightness / 1in * 1%) + +More info: https://sass-lang.com/d/function-units , 1 | a {b: hsl(0, 100%, 50in)} diff --git a/spec/core_functions/color/hwb/three_args/units.hrx b/spec/core_functions/color/hwb/three_args/units.hrx index d1ccf1def6..7ed79c62cc 100644 --- a/spec/core_functions/color/hwb/three_args/units.hrx +++ b/spec/core_functions/color/hwb/three_args/units.hrx @@ -24,7 +24,7 @@ DEPRECATION WARNING: $hue: Passing a unit other than deg (1rad) is deprecated. You're passing 1rad, which is currently (incorrectly) converted to 1deg. Soon, it will instead be correctly converted to 57.2957795131deg. -To preserve current behavior: $hue * 1deg/1rad +To preserve current behavior: calc($hue * 1deg/1rad) To migrate to new behavior: 0deg + $hue See https://sass-lang.com/d/color-units @@ -49,7 +49,7 @@ a { <===> hue/non_angle/warning DEPRECATION WARNING: $hue: Passing a unit other than deg (1in) is deprecated. -To preserve current behavior: $hue / 1in +To preserve current behavior: calc($hue / 1in) See https://sass-lang.com/d/color-units diff --git a/spec/core_functions/color/invert.hrx b/spec/core_functions/color/invert.hrx index 164049bc99..fb0d8976a6 100644 --- a/spec/core_functions/color/invert.hrx +++ b/spec/core_functions/color/invert.hrx @@ -116,6 +116,60 @@ a { b: turquoise; } +<===> +================================================================================ +<===> units/weight/unitless/options.yml +:ignore_for: + - libsass + +<===> units/weight/unitless/input.scss +a {b: invert(turquoise, 10)} + +<===> units/weight/unitless/output.css +a { + b: #4dcdc0; +} + +<===> units/weight/unitless/warning +DEPRECATION WARNING: $weight: Passing a number without unit % (10) is deprecated. + +To preserve current behavior: $weight * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: invert(turquoise, 10)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> units/weight/unknown/options.yml +:ignore_for: + - libsass + +<===> units/weight/unknown/input.scss +a {b: invert(turquoise, 10px)} + +<===> units/weight/unknown/output.css +a { + b: #4dcdc0; +} + +<===> units/weight/unknown/warning +DEPRECATION WARNING: $weight: Passing a number without unit % (10px) is deprecated. + +To preserve current behavior: calc($weight / 1px * 1%) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: invert(turquoise, 10px)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -222,13 +276,13 @@ Error: argument `$weight` of `invert($color, $weight: 100%)` must be a number <===> ================================================================================ <===> error/bounds/too_low/input.scss -a {b: invert(red, -0.001)} +a {b: invert(red, -0.001%)} <===> error/bounds/too_low/error -Error: $weight: Expected -0.001 to be within 0 and 100. +Error: $weight: Expected -0.001% to be within 0% and 100%. , -1 | a {b: invert(red, -0.001)} - | ^^^^^^^^^^^^^^^^^^^ +1 | a {b: invert(red, -0.001%)} + | ^^^^^^^^^^^^^^^^^^^^ ' input.scss 1:7 root stylesheet @@ -243,13 +297,13 @@ Error: argument `$weight` of `invert($color, $weight: 100%)` must be between -0 <===> ================================================================================ <===> error/bounds/too_high/input.scss -a {b: invert(red, 100.001)} +a {b: invert(red, 100.001%)} <===> error/bounds/too_high/error -Error: $weight: Expected 100.001 to be within 0 and 100. +Error: $weight: Expected 100.001% to be within 0% and 100%. , -1 | a {b: invert(red, 100.001)} - | ^^^^^^^^^^^^^^^^^^^^ +1 | a {b: invert(red, 100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^ ' input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/mix.hrx b/spec/core_functions/color/mix.hrx index c7904fa3c7..2f6d21c09d 100644 --- a/spec/core_functions/color/mix.hrx +++ b/spec/core_functions/color/mix.hrx @@ -79,26 +79,6 @@ a { b: #3f889d; } -<===> -================================================================================ -<===> unitless_weight/firstwards/input.scss -a {b: mix(#91e16f, #0144bf, 92)} - -<===> unitless_weight/firstwards/output.css -a { - b: #85d475; -} - -<===> -================================================================================ -<===> unitless_weight/lastwards/input.scss -a {b: mix(#91e16f, #0144bf, 43)} - -<===> unitless_weight/lastwards/output.css -a { - b: #3f889d; -} - <===> ================================================================================ <===> alpha/even/input.scss @@ -232,6 +212,60 @@ a { b: #85d475; } +<===> +================================================================================ +<===> units/weight/unitless/options.yml +:ignore_for: + - libsass + +<===> units/weight/unitless/input.scss +a {b: mix(#91e16f, #0144bf, 50)} + +<===> units/weight/unitless/output.css +a { + b: #499397; +} + +<===> units/weight/unitless/warning +DEPRECATION WARNING: $weight: Passing a number without unit % (50) is deprecated. + +To preserve current behavior: $weight * 1% + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: mix(#91e16f, #0144bf, 50)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> units/weight/unknown/options.yml +:ignore_for: + - libsass + +<===> units/weight/unknown/input.scss +a {b: mix(#91e16f, #0144bf, 50px)} + +<===> units/weight/unknown/output.css +a { + b: #499397; +} + +<===> units/weight/unknown/warning +DEPRECATION WARNING: $weight: Passing a number without unit % (50px) is deprecated. + +To preserve current behavior: calc($weight / 1px * 1%) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: mix(#91e16f, #0144bf, 50px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + <===> ================================================================================ <===> error/too_many_args/input.scss @@ -346,13 +380,13 @@ Error: argument `$weight` of `mix($color1, $color2, $weight: 50%)` must be a num <===> ================================================================================ <===> error/bounds/too_low/input.scss -a {b: mix(red, blue, -0.001)} +a {b: mix(red, blue, -0.001%)} <===> error/bounds/too_low/error -Error: $weight: Expected -0.001 to be within 0 and 100. +Error: $weight: Expected -0.001% to be within 0% and 100%. , -1 | a {b: mix(red, blue, -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^^ +1 | a {b: mix(red, blue, -0.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 1:7 root stylesheet @@ -367,13 +401,13 @@ Error: argument `$weight` of `mix($color1, $color2, $weight: 50%)` must be betwe <===> ================================================================================ <===> error/bounds/too_high/input.scss -a {b: mix(red, blue, 100.001)} +a {b: mix(red, blue, 100.001%)} <===> error/bounds/too_high/error -Error: $weight: Expected 100.001 to be within 0 and 100. +Error: $weight: Expected 100.001% to be within 0% and 100%. , -1 | a {b: mix(red, blue, 100.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^ +1 | a {b: mix(red, blue, 100.001%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^ ' input.scss 1:7 root stylesheet diff --git a/spec/core_functions/list/nth.hrx b/spec/core_functions/list/nth.hrx index a06fb0785a..65ad358c36 100644 --- a/spec/core_functions/list/nth.hrx +++ b/spec/core_functions/list/nth.hrx @@ -116,6 +116,33 @@ a { b: d; } +<===> +================================================================================ +<===> units/options.yml +:ignore_for: + - libsass + +<===> units/input.scss +a {b: nth(c d, 1px)} + +<===> units/output.css +a { + b: c; +} + +<===> units/warning +DEPRECATION WARNING: $n: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($n / 1px) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: nth(c d, 1px)} + | ^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + <===> ================================================================================ <===> error/type/input.scss diff --git a/spec/core_functions/list/set_nth.hrx b/spec/core_functions/list/set_nth.hrx index 10be544804..1094bba9c8 100644 --- a/spec/core_functions/list/set_nth.hrx +++ b/spec/core_functions/list/set_nth.hrx @@ -131,6 +131,33 @@ a { b: [c, e]; } +<===> +================================================================================ +<===> units/options.yml +:ignore_for: + - libsass + +<===> units/input.scss +a {b: set-nth(c d, 1px, e)} + +<===> units/output.css +a { + b: e d; +} + +<===> units/warning +DEPRECATION WARNING: $n: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($n / 1px) + +More info: https://sass-lang.com/d/function-units + + , +1 | a {b: set-nth(c d, 1px, e)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + <===> ================================================================================ <===> error/type/input.scss diff --git a/spec/core_functions/math/random.hrx b/spec/core_functions/math/random.hrx index d2ca87cd30..e125e8f621 100644 --- a/spec/core_functions/math/random.hrx +++ b/spec/core_functions/math/random.hrx @@ -89,13 +89,14 @@ a { } <===> ignores_units/warning -WARNING: math.random() will no longer ignore $limit units (1px) in a future release. +DEPRECATION WARNING: math.random() will no longer ignore $limit units (1px) in a future release. Recommendation: math.random(math.div($limit, 1px)) * 1px To preserve current behavior: math.random(math.div($limit, 1px)) -More info: https://sass-lang.com/d/random-with-units +More info: https://sass-lang.com/d/function-units + , 1 | a {b: random(1px)} | ^^^^^^^^^^^ diff --git a/spec/libsass/test.hrx b/spec/libsass/test.hrx index c2833e3df6..3b53f01844 100644 --- a/spec/libsass/test.hrx +++ b/spec/libsass/test.hrx @@ -1,3 +1,7 @@ +<===> options.yml +:ignore_for: + - libsass + <===> input.scss $x: 3; @@ -213,3 +217,16 @@ gudge { h1:lang(en) { foo: bar; } + +<===> warning +DEPRECATION WARNING: $n: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($n / 1px) + +More info: https://sass-lang.com/d/function-units + + , +46 | krug: nth(1 2 3, 2px); + | ^^^^^^^^^^^^^^^ + ' + input.scss 46:9 root stylesheet