Skip to content

Commit

Permalink
Convert adjust-hue to color.adjust (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
jathak authored Oct 1, 2019
1 parent c30f734 commit 4b6fecc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/src/migrators/module/built_in_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const builtInFunctionNameChanges = {
/// If the value from the removed function must be negated when passed to
/// `adjust-color`, the parameter ends with a `-`.
const removedColorFunctions = {
"adjust-hue": r"$hue: ",
"lighten": r"$lightness: ",
"darken": r"$lightness: -",
"saturate": r"$saturation: ",
Expand Down
2 changes: 2 additions & 0 deletions test/migrators/module/convert_color_adjust.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $f: fade-in($color: purple, $amount: 10%);
$g: transparentize(#37f, 20%);
$h: fade-out(rgba(10, 20, 30, 0.5), 10%);
$i: lighten(pink, 5%, 10%); // too many arguments
$j: adjust-hue(green, 10%);

<==> output/entrypoint.scss
@use "sass:color";
Expand All @@ -20,6 +21,7 @@ $f: color.adjust($color: purple, $alpha: 10%);
$g: color.adjust(#37f, $alpha: -20%);
$h: color.adjust(rgba(10, 20, 30, 0.5), $alpha: -10%);
$i: lighten(pink, 5%, 10%); // too many arguments
$j: color.adjust(green, $hue: 10%);

<==> warning.txt
WARNING on line 9, column 5 of entrypoint.scss: Could not migrate malformed 'lighten' call
Expand Down

0 comments on commit 4b6fecc

Please sign in to comment.