Skip to content

Commit

Permalink
Add specs for passing non-deg units to hwb's hue
Browse files Browse the repository at this point in the history
See #1607
  • Loading branch information
nex3 committed Jul 19, 2022
1 parent 8099969 commit 04bd914
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/core_functions/color/adjust_hue.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ a {
}

<===> units/unknown/warning
DEPRECATION WARNING: $null: Passing a unit other than deg (60in) is deprecated.
DEPRECATION WARNING: $degrees: Passing a unit other than deg (60in) is deprecated.

To preserve current behavior: $null / 1in
To preserve current behavior: $degrees / 1in

See https://sass-lang.com/d/color-units

Expand All @@ -137,13 +137,13 @@ a {
}

<===> units/angle/warning
DEPRECATION WARNING: $null: Passing a unit other than deg (60rad) is deprecated.
DEPRECATION WARNING: $degrees: 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: $null * 1deg/1rad
To migrate to new behavior: 0deg + $null
To preserve current behavior: $degrees * 1deg/1rad
To migrate to new behavior: 0deg + $degrees

See https://sass-lang.com/d/color-units

Expand Down
52 changes: 52 additions & 0 deletions spec/core_functions/color/hwb/three_args/units.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,55 @@ a {b: color.hwb(0deg, 30%, 40%)}
a {
b: #994d4d;
}

<===>
================================================================================
<===> hue/rad/input.scss
@use 'sass:color';
a {b: color.hwb(1rad, 30%, 40%)}

<===> hue/rad/output.css
a {
b: #994e4d;
}

<===> hue/rad/warning
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 migrate to new behavior: 0deg + $hue

See https://sass-lang.com/d/color-units

,
2 | a {b: color.hwb(1rad, 30%, 40%)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> hue/non_angle/input.scss
@use 'sass:color';
a {b: color.hwb(1in, 30%, 40%)}

<===> hue/non_angle/output.css
a {
b: #994e4d;
}

<===> hue/non_angle/warning
DEPRECATION WARNING: $hue: Passing a unit other than deg (1in) is deprecated.

To preserve current behavior: $hue / 1in

See https://sass-lang.com/d/color-units

,
2 | a {b: color.hwb(1in, 30%, 40%)}
| ^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

0 comments on commit 04bd914

Please sign in to comment.