diff --git a/spec/core_functions/color/adjust_color/error/bounds.hrx b/spec/core_functions/color/adjust_color/error/bounds.hrx index a14f9eb414..e44dd00980 100644 --- a/spec/core_functions/color/adjust_color/error/bounds.hrx +++ b/spec/core_functions/color/adjust_color/error/bounds.hrx @@ -243,7 +243,7 @@ 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%) , 3 | a {b: adjust-color(red, $saturation: 200px)} @@ -318,7 +318,7 @@ 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%) , 3 | a {b: adjust-color(red, $lightness: 200px)} @@ -391,6 +391,16 @@ Error: argument `$alpha` of `adjust-color($color, $red: false, $green: false, $b a {b: adjust-color(red, $alpha: 50%)} <===> alpha/unit/error +WARNING: $alpha: Passing a number with unit % is deprecated. + +To preserve current behavior: calc($alpha / 1%) + + , +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..2582261eb8 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 @@ -117,7 +117,7 @@ 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%) , 1 | a {b: adjust-color(red, $saturation: -10in)} @@ -169,10 +169,62 @@ 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%) , 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 +WARNING: $alpha: Passing a number with unit % is deprecated. + +To preserve current behavior: calc($alpha / 1%) + + , +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 +WARNING: $alpha: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($alpha / 1px) + + , +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..66ef95d9f1 100644 --- a/spec/core_functions/color/change_color/error/bounds.hrx +++ b/spec/core_functions/color/change_color/error/bounds.hrx @@ -243,7 +243,7 @@ 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%) , 3 | a {b: change-color(red, $saturation: 200px)} @@ -318,7 +318,7 @@ 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%) , 3 | a {b: change-color(red, $lightness: 200px)} @@ -391,6 +391,16 @@ Error: argument `$alpha` of `change-color($color, $red: false, $green: false, $b a {b: change-color(red, $alpha: 50%)} <===> alpha/unit/error +WARNING: $alpha: Passing a number with unit % is deprecated. + +To preserve current behavior: calc($alpha / 1%) + + , +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..c7c77a0bd4 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 @@ -117,7 +117,7 @@ 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%) , 1 | a {b: change-color(red, $saturation: 50in)} @@ -169,10 +169,62 @@ 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%) , 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 +WARNING: $alpha: Passing a number with unit % is deprecated. + +To preserve current behavior: calc($alpha / 1%) + + , +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 +WARNING: $alpha: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($alpha / 1px) + + , +1 | a {b: adjust-color(red, $alpha: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/hsl/three_args/units.hrx b/spec/core_functions/color/hsl/three_args/units.hrx index 5fa4ff6dbd..76e59d2a91 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 @@ -143,7 +143,7 @@ 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%) , 1 | a {b: hsl(0, 50in, 50%)} @@ -199,7 +199,7 @@ 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%) , 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..acd1e70248 100644 --- a/spec/core_functions/color/invert.hrx +++ b/spec/core_functions/color/invert.hrx @@ -116,6 +116,48 @@ a { b: turquoise; } +<===> +================================================================================ +<===> 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% + + , +1 | a {b: invert(turquoise, 10)} + | ^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> 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%) + + , +1 | a {b: invert(turquoise, 10px)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + <===> ================================================================================ <===> error/too_few_args/input.scss @@ -222,13 +264,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 +285,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..db23914cc7 100644 --- a/spec/core_functions/color/mix.hrx +++ b/spec/core_functions/color/mix.hrx @@ -82,7 +82,7 @@ a { <===> ================================================================================ <===> unitless_weight/firstwards/input.scss -a {b: mix(#91e16f, #0144bf, 92)} +a {b: mix(#91e16f, #0144bf, 92%)} <===> unitless_weight/firstwards/output.css a { @@ -92,7 +92,7 @@ a { <===> ================================================================================ <===> unitless_weight/lastwards/input.scss -a {b: mix(#91e16f, #0144bf, 43)} +a {b: mix(#91e16f, #0144bf, 43%)} <===> unitless_weight/lastwards/output.css a { @@ -232,6 +232,48 @@ a { b: #85d475; } +<===> +================================================================================ +<===> 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% + + , +1 | a {b: mix(#91e16f, #0144bf, 50)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + +<===> +================================================================================ +<===> 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%) + + , +1 | a {b: mix(#91e16f, #0144bf, 50px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + <===> ================================================================================ <===> error/too_many_args/input.scss @@ -349,6 +391,16 @@ Error: argument `$weight` of `mix($color1, $color2, $weight: 50%)` must be a num a {b: mix(red, blue, -0.001)} <===> error/bounds/too_low/error +DEPRECATION WARNING: $weight: Passing a number without unit % (-0.001) is deprecated. + +To preserve current behavior: $weight * 1% + + , +1 | a {b: mix(red, blue, -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + Error: $weight: Expected -0.001 to be within 0 and 100. , 1 | a {b: mix(red, blue, -0.001)} @@ -370,6 +422,16 @@ Error: argument `$weight` of `mix($color1, $color2, $weight: 50%)` must be betwe a {b: mix(red, blue, 100.001)} <===> error/bounds/too_high/error +DEPRECATION WARNING: $weight: Passing a number without unit % (100.001) is deprecated. + +To preserve current behavior: $weight * 1% + + , +1 | a {b: mix(red, blue, 100.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + Error: $weight: Expected 100.001 to be within 0 and 100. , 1 | a {b: mix(red, blue, 100.001)} diff --git a/spec/core_functions/list/nth.hrx b/spec/core_functions/list/nth.hrx index a06fb0785a..2026bc15f8 100644 --- a/spec/core_functions/list/nth.hrx +++ b/spec/core_functions/list/nth.hrx @@ -116,6 +116,27 @@ a { b: d; } +<===> +================================================================================ +<===> units/input.scss +a {b: nth(c d, 1px)} + +<===> units/output.css +a { + b: c; +} + +<===> units/warning +WARNING: $n: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($n / 1px) + + , +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..f4ac565e63 100644 --- a/spec/core_functions/list/set_nth.hrx +++ b/spec/core_functions/list/set_nth.hrx @@ -131,6 +131,27 @@ a { b: [c, e]; } +<===> +================================================================================ +<===> units/input.scss +a {b: set-nth(c d, 1px, e)} + +<===> units/output.css +a { + b: e d; +} + +<===> units/warning +WARNING: $n: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($n / 1px) + + , +1 | a {b: set-nth(c d, 1px, e)} + | ^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 1:7 root stylesheet + <===> ================================================================================ <===> error/type/input.scss diff --git a/spec/libsass/test.hrx b/spec/libsass/test.hrx index c2833e3df6..d1102867c3 100644 --- a/spec/libsass/test.hrx +++ b/spec/libsass/test.hrx @@ -213,3 +213,14 @@ gudge { h1:lang(en) { foo: bar; } + +<===> warning +WARNING: $n: Passing a number with unit px is deprecated. + +To preserve current behavior: calc($n / 1px) + + , +46 | krug: nth(1 2 3, 2px); + | ^^^^^^^^^^^^^^^ + ' + input.scss 46:9 root stylesheet