diff --git a/spec/core_functions/color/change/a98_rgb.hrx b/spec/core_functions/color/change/a98_rgb.hrx new file mode 100644 index 0000000000..df07bd4b50 --- /dev/null +++ b/spec/core_functions/color/change/a98_rgb.hrx @@ -0,0 +1,129 @@ +<===> red/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(a98-rgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(a98-rgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(a98-rgb 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(a98-rgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(a98-rgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(a98-rgb 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(a98-rgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(a98-rgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(a98-rgb 0.2 0.5 100); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(a98-rgb 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(a98-rgb 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(a98-rgb 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/display_p3.hrx b/spec/core_functions/color/change/display_p3.hrx new file mode 100644 index 0000000000..a3129b4ceb --- /dev/null +++ b/spec/core_functions/color/change/display_p3.hrx @@ -0,0 +1,129 @@ +<===> red/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(display-p3 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(display-p3 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(display-p3 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(display-p3 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(display-p3 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(display-p3 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(display-p3 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(display-p3 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(display-p3 0.2 0.5 100); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(display-p3 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(display-p3 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(display-p3 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change_color/error/args.hrx b/spec/core_functions/color/change/error/args.hrx similarity index 68% rename from spec/core_functions/color/change_color/error/args.hrx rename to spec/core_functions/color/change/error/args.hrx index f5772aea44..c78b5593bb 100644 --- a/spec/core_functions/color/change_color/error/args.hrx +++ b/spec/core_functions/color/change/error/args.hrx @@ -1,40 +1,43 @@ <===> too_few/input.scss -a {b: change-color()} +@use 'sass:color'; +a {b: color.change()} <===> too_few/error Error: Missing argument $color. ,--> input.scss -1 | a {b: change-color()} +2 | a {b: color.change()} | ^^^^^^^^^^^^^^ invocation ' ,--> sass:color 1 | @function change($color, $kwargs...) { | ========================== declaration ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> too_many/input.scss -a {b: change-color(red, 1)} +@use 'sass:color'; +a {b: color.change(red, 1)} <===> too_many/error Error: Only one positional argument is allowed. All other arguments must be passed by name. , -1 | a {b: change-color(red, 1)} +2 | a {b: color.change(red, 1)} | ^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> unknown/input.scss -a {b: change-color(red, $ambience: 10%)} +@use 'sass:color'; +a {b: color.change(red, $ambience: 10%)} <===> unknown/error Error: $ambience: Color space rgb doesn't have a channel with this name. , -1 | a {b: change-color(red, $ambience: 10%)} +2 | a {b: color.change(red, $ambience: 10%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/bounds.hrx b/spec/core_functions/color/change/error/bounds.hrx new file mode 100644 index 0000000000..855de13fd8 --- /dev/null +++ b/spec/core_functions/color/change/error/bounds.hrx @@ -0,0 +1,39 @@ +<===> alpha/too_low/input.scss +@use 'sass:color'; +a {b: color.change(red, $alpha: -0.001)} + +<===> alpha/too_low/error +Error: $alpha: Expected -0.001 to be within 0 and 1. + , +2 | a {b: color.change(red, $alpha: -0.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/too_high/input.scss +@use 'sass:color'; +a {b: color.change(red, $alpha: 1.001)} + +<===> alpha/too_high/error +Error: $alpha: Expected 1.001 to be within 0 and 1. + , +2 | a {b: color.change(red, $alpha: 1.001)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> alpha/unit/input.scss +@use 'sass:color'; +a {b: color.change(red, $alpha: 150%)} + +<===> alpha/unit/error +Error: $alpha: Expected 150% to be within 0% and 100%. + , +2 | a {b: color.change(red, $alpha: 150%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/incompatible_channel.hrx b/spec/core_functions/color/change/error/incompatible_channel.hrx new file mode 100644 index 0000000000..e31e48ce1f --- /dev/null +++ b/spec/core_functions/color/change/error/incompatible_channel.hrx @@ -0,0 +1,39 @@ +<===> legacy_space/input.scss +@use 'sass:color'; +a {b: color.change(red, $chroma: 50%)} + +<===> legacy_space/error +Error: $chroma: Color space rgb doesn't have a channel with this name. + , +2 | a {b: color.change(red, $chroma: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> legacy_channel/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $whiteness: 50%)} + +<===> legacy_channel/error +Error: $whiteness: Color space srgb doesn't have a channel with this name. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $whiteness: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> modern_both/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $chroma: 50%)} + +<===> modern_both/error +Error: $chroma: Color space srgb doesn't have a channel with this name. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $chroma: 50%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/mixed_formats.hrx b/spec/core_functions/color/change/error/mixed_formats.hrx similarity index 68% rename from spec/core_functions/color/change_color/error/mixed_formats.hrx rename to spec/core_functions/color/change/error/mixed_formats.hrx index 6184c89c8a..b02876f20f 100644 --- a/spec/core_functions/color/change_color/error/mixed_formats.hrx +++ b/spec/core_functions/color/change/error/mixed_formats.hrx @@ -1,39 +1,42 @@ <===> red_and_hue/input.scss -a {b: change-color(red, $red: 1, $hue: 1)} +@use 'sass:color'; +a {b: color.change(red, $red: 1, $hue: 1)} <===> red_and_hue/error Error: $hue: Color space rgb doesn't have a channel with this name. , -1 | a {b: change-color(red, $red: 1, $hue: 1)} +2 | a {b: color.change(red, $red: 1, $hue: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green_and_saturation/input.scss -a {b: change-color(red, $green: 1, $saturation: 1%)} +@use 'sass:color'; +a {b: color.change(red, $green: 1, $saturation: 1%)} <===> green_and_saturation/error Error: $saturation: Color space rgb doesn't have a channel with this name. , -1 | a {b: change-color(red, $green: 1, $saturation: 1%)} +2 | a {b: color.change(red, $green: 1, $saturation: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue_and_lightness/input.scss -a {b: change-color(red, $blue: 1, $lightness: 1%)} +@use 'sass:color'; +a {b: color.change(red, $blue: 1, $lightness: 1%)} <===> blue_and_lightness/error Error: $lightness: Color space rgb doesn't have a channel with this name. , -1 | a {b: change-color(red, $blue: 1, $lightness: 1%)} +2 | a {b: color.change(red, $blue: 1, $lightness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ @@ -51,38 +54,41 @@ Error: $blackness: Color space rgb doesn't have a channel with this name. <===> ================================================================================ <===> green_and_whiteness/input.scss -a {b: change-color(red, $green: 1, $whiteness: 1%)} +@use 'sass:color'; +a {b: color.change(red, $green: 1, $whiteness: 1%)} <===> green_and_whiteness/error Error: $whiteness: Color space rgb doesn't have a channel with this name. , -1 | a {b: change-color(red, $green: 1, $whiteness: 1%)} +2 | a {b: color.change(red, $green: 1, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation_and_blackness/input.scss -a {b: change-color(red, $saturation: 1%, $blackness: 1%)} +@use 'sass:color'; +a {b: color.change(red, $saturation: 1%, $blackness: 1%)} <===> saturation_and_blackness/error Error: $blackness: Color space hsl doesn't have a channel with this name. , -1 | a {b: change-color(red, $saturation: 1%, $blackness: 1%)} +2 | a {b: color.change(red, $saturation: 1%, $blackness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness_and_whiteness/input.scss -a {b: change-color(red, $lightness: 1%, $whiteness: 1%)} +@use 'sass:color'; +a {b: color.change(red, $lightness: 1%, $whiteness: 1%)} <===> lightness_and_whiteness/error Error: $whiteness: Color space hsl doesn't have a channel with this name. , -1 | a {b: change-color(red, $lightness: 1%, $whiteness: 1%)} +2 | a {b: color.change(red, $lightness: 1%, $whiteness: 1%)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/space.hrx b/spec/core_functions/color/change/error/space.hrx new file mode 100644 index 0000000000..01f2e35374 --- /dev/null +++ b/spec/core_functions/color/change/error/space.hrx @@ -0,0 +1,25 @@ +<===> unknown/input.scss +@use 'sass:color'; +a {b: color.change(red, $space: c)} + +<===> unknown/error +Error: $space: Unknown color space "c". + , +2 | a {b: color.change(red, $space: c)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> quoted/input.scss +@use 'sass:color'; +a {b: color.change(red, $space: "lab")} + +<===> quoted/error +Error: $space: Expected "lab" to be an unquoted string. + , +2 | a {b: color.change(red, $space: "lab")} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/type.hrx b/spec/core_functions/color/change/error/type.hrx similarity index 57% rename from spec/core_functions/color/change_color/error/type.hrx rename to spec/core_functions/color/change/error/type.hrx index 11b12fe7ad..63b1f9728b 100644 --- a/spec/core_functions/color/change_color/error/type.hrx +++ b/spec/core_functions/color/change/error/type.hrx @@ -1,127 +1,151 @@ <===> color/input.scss -a {b: change-color(1)} +@use 'sass:color'; +a {b: color.change(1)} <===> color/error Error: $color: 1 is not a color. , -1 | a {b: change-color(1)} +2 | a {b: color.change(1)} | ^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> red/input.scss -a {b: change-color(red, $red: c)} +@use 'sass:color'; +a {b: color.change(red, $red: c)} <===> red/error Error: $red: c is not a number or unquoted "none". , -1 | a {b: change-color(red, $red: c)} +2 | a {b: color.change(red, $red: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> green/input.scss -a {b: change-color(red, $green: c)} +@use 'sass:color'; +a {b: color.change(red, $green: c)} <===> green/error Error: $green: c is not a number or unquoted "none". , -1 | a {b: change-color(red, $green: c)} +2 | a {b: color.change(red, $green: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blue/input.scss -a {b: change-color(red, $blue: c)} +@use 'sass:color'; +a {b: color.change(red, $blue: c)} <===> blue/error Error: $blue: c is not a number or unquoted "none". , -1 | a {b: change-color(red, $blue: c)} +2 | a {b: color.change(red, $blue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> hue/input.scss -a {b: change-color(red, $hue: c)} +@use 'sass:color'; +a {b: color.change(red, $hue: c)} <===> hue/error Error: $hue: c is not a number or unquoted "none". , -1 | a {b: change-color(red, $hue: c)} +2 | a {b: color.change(red, $hue: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> saturation/input.scss -a {b: change-color(red, $saturation: c)} +@use 'sass:color'; +a {b: color.change(red, $saturation: c)} <===> saturation/error Error: $saturation: c is not a number or unquoted "none". , -1 | a {b: change-color(red, $saturation: c)} +2 | a {b: color.change(red, $saturation: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> lightness/input.scss -a {b: change-color(red, $lightness: c)} +@use 'sass:color'; +a {b: color.change(red, $lightness: c)} <===> lightness/error Error: $lightness: c is not a number or unquoted "none". , -1 | a {b: change-color(red, $lightness: c)} +2 | a {b: color.change(red, $lightness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> alpha/input.scss -a {b: change-color(red, $alpha: c)} +@use 'sass:color'; +a {b: color.change(red, $alpha: c)} <===> alpha/error Error: $alpha: c is not a number. , -1 | a {b: change-color(red, $alpha: c)} +2 | a {b: color.change(red, $alpha: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> blackness/input.scss -a {b: change-color(red, $blackness: c)} +@use 'sass:color'; +a {b: color.change(red, $blackness: c)} <===> blackness/error Error: $blackness: c is not a number or unquoted "none". , -1 | a {b: change-color(red, $blackness: c)} +2 | a {b: color.change(red, $blackness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> whiteness/input.scss -a {b: change-color(red, $whiteness: c)} +@use 'sass:color'; +a {b: color.change(red, $whiteness: c)} <===> whiteness/error Error: $whiteness: c is not a number or unquoted "none". , -1 | a {b: change-color(red, $whiteness: c)} +2 | a {b: color.change(red, $whiteness: c)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> space/input.scss +@use 'sass:color'; +a {b: color.change(red, $space: 1)} + +<===> space/error +Error: $space: 1 is not a string. + , +2 | a {b: color.change(red, $space: 1)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/a98_rgb.hrx b/spec/core_functions/color/change/error/units/a98_rgb.hrx new file mode 100644 index 0000000000..a5f63c8794 --- /dev/null +++ b/spec/core_functions/color/change/error/units/a98_rgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use 'sass:color'; +a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(a98-rgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/display_p3.hrx b/spec/core_functions/color/change/error/units/display_p3.hrx new file mode 100644 index 0000000000..97d91bc967 --- /dev/null +++ b/spec/core_functions/color/change/error/units/display_p3.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(display-p3 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(display-p3 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use 'sass:color'; +a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(display-p3 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change_color/error/units.hrx b/spec/core_functions/color/change/error/units/hwb.hrx similarity index 61% rename from spec/core_functions/color/change_color/error/units.hrx rename to spec/core_functions/color/change/error/units/hwb.hrx index ba99c38183..115e87e0dd 100644 --- a/spec/core_functions/color/change_color/error/units.hrx +++ b/spec/core_functions/color/change/error/units/hwb.hrx @@ -1,50 +1,53 @@ <===> none/whiteness/input.scss -a {b: change-color(white, $whiteness: 1)} +@use 'sass:color'; +a {b: color.change(white, $whiteness: 1)} <===> none/whiteness/error Error: $whiteness: Expected 1 to have unit "%". , -1 | a {b: change-color(white, $whiteness: 1)} +2 | a {b: color.change(white, $whiteness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet - + input.scss 2:7 root stylesheet <===> ================================================================================ <===> none/blackness/input.scss -a {b: change-color(black, $blackness: 1)} +@use 'sass:color'; +a {b: color.change(black, $blackness: 1)} <===> none/blackness/error Error: $blackness: Expected 1 to have unit "%". , -1 | a {b: change-color(black, $blackness: 1)} +2 | a {b: color.change(black, $blackness: 1)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/whiteness/input.scss -a {b: change-color(white, $whiteness: 1px)} +@use 'sass:color'; +a {b: color.change(white, $whiteness: 1px)} <===> wrong/whiteness/error Error: $whiteness: Expected 1px to have unit "%". , -1 | a {b: change-color(white, $whiteness: 1px)} +2 | a {b: color.change(white, $whiteness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet <===> ================================================================================ <===> wrong/blackness/input.scss -a {b: change-color(black, $blackness: 1px)} +@use 'sass:color'; +a {b: color.change(black, $blackness: 1px)} <===> wrong/blackness/error Error: $blackness: Expected 1px to have unit "%". , -1 | a {b: change-color(black, $blackness: 1px)} +2 | a {b: color.change(black, $blackness: 1px)} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' - input.scss 1:7 root stylesheet + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/lab.hrx b/spec/core_functions/color/change/error/units/lab.hrx new file mode 100644 index 0000000000..6fa7249055 --- /dev/null +++ b/spec/core_functions/color/change/error/units/lab.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 30 -50), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.change(lab(50% 30 -50), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> a/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 30 -50), $a: 20px)} + +<===> a/error +Error: $a: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.change(lab(50% 30 -50), $a: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> b/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 30 -50), $b: 20px)} + +<===> b/error +Error: $b: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.change(lab(50% 30 -50), $b: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/lch.hrx b/spec/core_functions/color/change/error/units/lch.hrx new file mode 100644 index 0000000000..0c08c79dd8 --- /dev/null +++ b/spec/core_functions/color/change/error/units/lch.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 30 50deg), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.change(lch(50% 30 50deg), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> chroma/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 30 50deg), $chroma: 20px)} + +<===> chroma/error +Error: $chroma: Expected 20px to have unit "%" or no units. + , +2 | a {b: color.change(lch(50% 30 50deg), $chroma: 20px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> hue/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 30 50deg), $hue: 20%)} + +<===> hue/error +Error: $hue: Expected 20% to have an angle unit (deg, grad, rad, turn). + , +2 | a {b: color.change(lch(50% 30 50deg), $hue: 20%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/oklab.hrx b/spec/core_functions/color/change/error/units/oklab.hrx new file mode 100644 index 0000000000..c2210ee2ee --- /dev/null +++ b/spec/core_functions/color/change/error/units/oklab.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 0.3px)} + +<===> lightness/error +Error: $lightness: Expected 0.3px to have unit "%" or no units. + , +2 | a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 0.3px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> a/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $a: 0.2px)} + +<===> a/error +Error: $a: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.change(oklab(50% 0.2 -0.3), $a: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> b/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $b: 0.2px)} + +<===> b/error +Error: $b: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.change(oklab(50% 0.2 -0.3), $b: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/oklch.hrx b/spec/core_functions/color/change/error/units/oklch.hrx new file mode 100644 index 0000000000..f89fc46da4 --- /dev/null +++ b/spec/core_functions/color/change/error/units/oklch.hrx @@ -0,0 +1,39 @@ +<===> lightness/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.3 50deg), $lightness: 30px)} + +<===> lightness/error +Error: $lightness: Expected 30px to have unit "%" or no units. + , +2 | a {b: color.change(oklch(50% 0.3 50deg), $lightness: 30px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> chroma/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.3 50deg), $chroma: 0.2px)} + +<===> chroma/error +Error: $chroma: Expected 0.2px to have unit "%" or no units. + , +2 | a {b: color.change(oklch(50% 0.3 50deg), $chroma: 0.2px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> hue/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.3 50deg), $hue: 20%)} + +<===> hue/error +Error: $hue: Expected 20% to have an angle unit (deg, grad, rad, turn). + , +2 | a {b: color.change(oklch(50% 0.3 50deg), $hue: 20%)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/prophoto_rgb.hrx b/spec/core_functions/color/change/error/units/prophoto_rgb.hrx new file mode 100644 index 0000000000..eb44f0ec4e --- /dev/null +++ b/spec/core_functions/color/change/error/units/prophoto_rgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/rec2020.hrx b/spec/core_functions/color/change/error/units/rec2020.hrx new file mode 100644 index 0000000000..4193d05aef --- /dev/null +++ b/spec/core_functions/color/change/error/units/rec2020.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/srgb.hrx b/spec/core_functions/color/change/error/units/srgb.hrx new file mode 100644 index 0000000000..9d583bf7fd --- /dev/null +++ b/spec/core_functions/color/change/error/units/srgb.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/srgb_linear.hrx b/spec/core_functions/color/change/error/units/srgb_linear.hrx new file mode 100644 index 0000000000..6f6df601d3 --- /dev/null +++ b/spec/core_functions/color/change/error/units/srgb_linear.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.5px)} + +<===> red/error +Error: $red: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: 0.5px)} + +<===> green/error +Error: $green: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 0.5px)} + +<===> blue/error +Error: $blue: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/xyz.hrx b/spec/core_functions/color/change/error/units/xyz.hrx new file mode 100644 index 0000000000..0e4f0c15d4 --- /dev/null +++ b/spec/core_functions/color/change/error/units/xyz.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.5px)} + +<===> red/error +Error: $x: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: 0.5px)} + +<===> green/error +Error: $y: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz 0.2 0.5 0.7), $y: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 0.5px)} + +<===> blue/error +Error: $z: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/error/units/xyz_d50.hrx b/spec/core_functions/color/change/error/units/xyz_d50.hrx new file mode 100644 index 0000000000..9a46b0ba59 --- /dev/null +++ b/spec/core_functions/color/change/error/units/xyz_d50.hrx @@ -0,0 +1,39 @@ +<===> red/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.5px)} + +<===> red/error +Error: $x: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> green/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: 0.5px)} + +<===> green/error +Error: $y: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> blue/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 0.5px)} + +<===> blue/error +Error: $z: Expected 0.5px to have unit "%" or no units. + , +2 | a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/global.hrx b/spec/core_functions/color/change/global.hrx new file mode 100644 index 0000000000..cf9f014dde --- /dev/null +++ b/spec/core_functions/color/change/global.hrx @@ -0,0 +1,17 @@ +<===> legacy/input.scss +a {b: change-color(red, $blue: 50)} + +<===> legacy/output.css +a { + b: #ff0032; +} + +<===> +================================================================================ +<===> non_legacy/input.scss +a {b: change-color(pink, $chroma: 0.06, $space: oklch)} + +<===> non_legacy/output.css +a { + b: rgb(247.5333900768, 195.811523731, 204.5286989775); +} diff --git a/spec/core_functions/color/change/hsl.hrx b/spec/core_functions/color/change/hsl.hrx new file mode 100644 index 0000000000..92e7ee0d26 --- /dev/null +++ b/spec/core_functions/color/change/hsl.hrx @@ -0,0 +1,425 @@ +<===> hue/max/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: 359)} + +<===> hue/max/output.css +a { + b: rgb(255, 0, 4.25); +} + +<===> +================================================================================ +<===> hue/above_max/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: 540)} + +<===> hue/above_max/output.css +a { + b: aqua; +} + +<===> +================================================================================ +<===> hue/min/input.scss +@use 'sass:color'; +a {b: color.change(blue, $hue: 0)} + +<===> hue/min/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> hue/negative/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: -60)} + +<===> hue/negative/output.css +a { + b: fuchsia; +} + +<===> +================================================================================ +<===> hue/middle/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: 123)} + +<===> hue/middle/output.css +a { + b: rgb(0, 255, 12.75); +} + +<===> +================================================================================ +<===> hue/fraction/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: 0.5)} + +<===> hue/fraction/output.css +a { + b: rgb(255, 2.125, 0); +} + +<===> +================================================================================ +<===> saturation/max/input.scss +@use 'sass:color'; +a {b: color.change(plum, $saturation: 100%)} + +<===> saturation/max/output.css +a { + b: #ff7eff; +} + +<===> +================================================================================ +<===> saturation/min/input.scss +@use 'sass:color'; +a {b: color.change(plum, $saturation: 0%)} + +<===> saturation/min/output.css +a { + b: rgb(190.5, 190.5, 190.5); +} + +<===> +================================================================================ +<===> saturation/high/input.scss +@use 'sass:color'; +a {b: color.change(plum, $saturation: 76%)} + +<===> saturation/high/output.css +a { + b: rgb(239.52, 141.48, 239.52); +} + +<===> +================================================================================ +<===> saturation/low/input.scss +@use 'sass:color'; +a {b: color.change(plum, $saturation: 14%)} + +<===> saturation/low/output.css +a { + b: rgb(199.53, 181.47, 199.53); +} + +<===> +================================================================================ +<===> saturation/above_range/input.scss +@use 'sass:color'; +a {b: color.change(plum, $saturation: 120%)} + +<===> saturation/above_range/output.css +a { + b: hsl(300, 120%, 74.7058823529%); +} + +<===> +================================================================================ +<===> saturation/below_range/input.scss +@use 'sass:color'; +a {b: color.change(plum, $saturation: -20%)} + +<===> saturation/below_range/output.css +a { + b: rgb(177.6, 203.4, 177.6); +} + +<===> +================================================================================ +<===> lightness/max/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 100%)} + +<===> lightness/max/output.css +a { + b: white; +} + +<===> +================================================================================ +<===> lightness/fraction/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 0.5%)} + +<===> lightness/fraction/output.css +a { + b: rgb(2.55, 0, 0); +} + +<===> +================================================================================ +<===> lightness/min/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 0%)} + +<===> lightness/min/output.css +a { + b: black; +} + +<===> +================================================================================ +<===> lightness/high/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 63%)} + +<===> lightness/high/output.css +a { + b: rgb(255, 66.3, 66.3); +} + +<===> +================================================================================ +<===> lightness/low/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 27%)} + +<===> lightness/low/output.css +a { + b: rgb(137.7, 0, 0); +} + +<===> +================================================================================ +<===> lightness/above_range/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 120%)} + +<===> lightness/above_range/output.css +a { + b: hsl(0, 100%, 120%); +} + +<===> +================================================================================ +<===> lightness/below_range/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: -20%)} + +<===> lightness/below_range/output.css +a { + b: hsl(0, 100%, -20%); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(black, $hue: 12, $saturation: 24%, $lightness: 48%)} + +<===> all/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} + +<===> alpha_input/output.css +a { + b: rgba(151.776, 104.7744, 93.024, 0.7); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} + +<===> alpha_arg/output.css +a { + b: rgba(151.776, 104.7744, 93.024, 0.7); +} + +<===> +================================================================================ +<===> units/hue/deg/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: 60deg)} + +<===> units/hue/deg/output.css +a { + b: yellow; +} + +<===> +================================================================================ +<===> units/hue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: 60)} + +<===> units/hue/unitless/output.css +a { + b: yellow; +} + +<===> +================================================================================ +<===> units/hue/unknown/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: 60in)} + +<===> units/hue/unknown/output.css +a { + b: yellow; +} + +<===> units/hue/unknown/warning +DEPRECATION WARNING: $hue: Passing a unit other than deg (60in) is deprecated. + +To preserve current behavior: calc($hue / 1in) + +See https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $hue: 60in)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> units/hue/angle/input.scss +@use 'sass:color'; +a {b: color.change(red, $hue: 60rad)} + +<===> units/hue/angle/output.css +a { + b: rgb(0, 179.576224164, 255); +} + +<===> +================================================================================ +<===> units/saturation/percent/input.scss +@use 'sass:color'; +a {b: color.change(red, $saturation: 50%)} + +<===> units/saturation/percent/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> +================================================================================ +<===> units/saturation/unitless/input.scss +@use 'sass:color'; +a {b: color.change(red, $saturation: 50)} + +<===> units/saturation/unitless/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> units/saturation/unitless/warning +DEPRECATION WARNING: $saturation: Passing a number without unit % (50) is deprecated. + +To preserve current behavior: $saturation * 1% + +More info: https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $saturation: 50)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> units/saturation/unknown/input.scss +@use 'sass:color'; +a {b: color.change(red, $saturation: 50in)} + +<===> units/saturation/unknown/output.css +a { + b: rgb(191.25, 63.75, 63.75); +} + +<===> units/saturation/unknown/warning +DEPRECATION WARNING: $saturation: Passing a number without unit % (50in) is deprecated. + +To preserve current behavior: calc($saturation / 1in * 1%) + +More info: https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $saturation: 50in)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> units/lightness/percent/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 30%)} + +<===> units/lightness/percent/output.css +a { + b: #990000; +} + +<===> +================================================================================ +<===> units/lightness/unitless/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 30)} + +<===> units/lightness/unitless/output.css +a { + b: #990000; +} + +<===> units/lightness/unitless/warning +DEPRECATION WARNING: $lightness: Passing a number without unit % (30) is deprecated. + +To preserve current behavior: $lightness * 1% + +More info: https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $lightness: 30)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> units/lightness/unknown/input.scss +@use 'sass:color'; +a {b: color.change(red, $lightness: 30in)} + +<===> units/lightness/unknown/output.css +a { + b: #990000; +} + +<===> units/lightness/unknown/warning +DEPRECATION WARNING: $lightness: Passing a number without unit % (30in) is deprecated. + +To preserve current behavior: calc($lightness / 1in * 1%) + +More info: https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $lightness: 30in)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet + +<===> +================================================================================ +<===> named/input.scss +@use 'sass:color'; +a {b: color.change($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} + +<===> named/output.css +a { + b: rgb(151.776, 104.7744, 93.024); +} diff --git a/spec/core_functions/color/change_color/hwb.hrx b/spec/core_functions/color/change/hwb.hrx similarity index 64% rename from spec/core_functions/color/change_color/hwb.hrx rename to spec/core_functions/color/change/hwb.hrx index 27acafc430..10afd24010 100644 --- a/spec/core_functions/color/change_color/hwb.hrx +++ b/spec/core_functions/color/change/hwb.hrx @@ -1,5 +1,6 @@ <===> whiteness/max/input.scss -a {b: change-color(#cc6666, $whiteness: 100%)} +@use 'sass:color'; +a {b: color.change(#cc6666, $whiteness: 100%)} <===> whiteness/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> whiteness/min/input.scss -a {b: change-color(#cc6666, $whiteness: 0%)} +@use 'sass:color'; +a {b: color.change(#cc6666, $whiteness: 0%)} <===> whiteness/min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> whiteness/high/input.scss -a {b: change-color(#cc6666, $whiteness: 80%)} +@use 'sass:color'; +a {b: color.change(#cc6666, $whiteness: 80%)} <===> whiteness/high/output.css a { @@ -29,7 +32,8 @@ a { <===> ================================================================================ <===> whiteness/low/input.scss -a {b: change-color(#cc6666, $whiteness: 20%)} +@use 'sass:color'; +a {b: color.change(#cc6666, $whiteness: 20%)} <===> whiteness/low/output.css a { @@ -39,7 +43,8 @@ a { <===> ================================================================================ <===> blackness/max/input.scss -a {b: change-color(#993333, $blackness: 100%)} +@use 'sass:color'; +a {b: color.change(#993333, $blackness: 100%)} <===> blackness/max/output.css a { @@ -49,7 +54,8 @@ a { <===> ================================================================================ <===> blackness/min/input.scss -a {b: change-color(#993333, $blackness: 0%)} +@use 'sass:color'; +a {b: color.change(#993333, $blackness: 0%)} <===> blackness/min/output.css a { @@ -59,7 +65,8 @@ a { <===> ================================================================================ <===> blackness/high/input.scss -a {b: change-color(#993333, $blackness: 80%)} +@use 'sass:color'; +a {b: color.change(#993333, $blackness: 80%)} <===> blackness/high/output.css a { @@ -69,17 +76,30 @@ a { <===> ================================================================================ <===> blackness/low/input.scss -a {b: change-color(#993333, $blackness: 20%)} +@use 'sass:color'; +a {b: color.change(#993333, $blackness: 20%)} <===> blackness/low/output.css a { b: #cc3333; } +<===> +================================================================================ +<===> out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(#993333, $whiteness: 50%, $blackness: -20%)} + +<===> out_of_range/output.css +a { + b: hsl(0, 233.3333333333%, 85%); +} + <===> ================================================================================ <===> all/input.scss -a {b: change-color(blue, $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use 'sass:color'; +a {b: color.change(blue, $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> all/output.css a { @@ -89,7 +109,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: change-color(rgba(blue, 0.7), $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use 'sass:color'; +a {b: color.change(rgba(blue, 0.7), $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> alpha_input/output.css a { @@ -99,7 +120,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: change-color(blue, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: 0.3)} +@use 'sass:color'; +a {b: color.change(blue, $hue: 150, $whiteness: 20%, $blackness: 40%, $alpha: 0.3)} <===> alpha_arg/output.css a { @@ -109,7 +131,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: change-color($color: blue, $hue: 150, $whiteness: 20%, $blackness: 40%)} +@use 'sass:color'; +a {b: color.change($color: blue, $hue: 150, $whiteness: 20%, $blackness: 40%)} <===> named/output.css a { diff --git a/spec/core_functions/color/change/lab.hrx b/spec/core_functions/color/change/lab.hrx new file mode 100644 index 0000000000..84d7bc0cd1 --- /dev/null +++ b/spec/core_functions/color/change/lab.hrx @@ -0,0 +1,129 @@ +<===> lightness/unitless/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $lightness: 30)} + +<===> lightness/unitless/output.css +a { + b: lab(30% 20 -30); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $lightness: 30%)} + +<===> lightness/percent/output.css +a { + b: lab(30% 20 -30); +} + +<===> +================================================================================ +<===> lightness/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $lightness: 120%)} + +<===> lightness/out_of_range/output.css +a { + b: color-mix(in lab, color(xyz 1.7255148283 1.6190494947 2.5266428703) 100%, black); +} + +<===> +================================================================================ +<===> a/unitless/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $a: 50)} + +<===> a/unitless/output.css +a { + b: lab(50% 50 -30); +} + +<===> +================================================================================ +<===> a/percent/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $a: -40%)} + +<===> a/percent/output.css +a { + b: lab(50% -50 -30); +} + +<===> +================================================================================ +<===> a/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $a: 200)} + +<===> a/out_of_range/output.css +a { + b: lab(50% 200 -30); +} + +<===> +================================================================================ +<===> b/unitless/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $b: 50)} + +<===> b/unitless/output.css +a { + b: lab(50% 20 50); +} + +<===> +================================================================================ +<===> b/percent/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $b: -40%)} + +<===> b/percent/output.css +a { + b: lab(50% 20 -50); +} + +<===> +================================================================================ +<===> b/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $b: -200)} + +<===> b/out_of_range/output.css +a { + b: lab(50% 20 -200); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $lightness: 20%, $a: -30, $b: 40)} + +<===> all/output.css +a { + b: lab(20% -30 40); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30 / 0.9), $lightness: 30%)} + +<===> alpha_input/output.css +a { + b: lab(30% 20 -30 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 20 -30), $lightness: 30%, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: lab(30% 20 -30 / 0.9); +} diff --git a/spec/core_functions/color/change/lch.hrx b/spec/core_functions/color/change/lch.hrx new file mode 100644 index 0000000000..fdb73abc42 --- /dev/null +++ b/spec/core_functions/color/change/lch.hrx @@ -0,0 +1,140 @@ +<===> lightness/unitless/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $lightness: 30)} + +<===> lightness/unitless/output.css +a { + b: lch(30% 20 30deg); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $lightness: 30%)} + +<===> lightness/percent/output.css +a { + b: lch(30% 20 30deg); +} + +<===> +================================================================================ +<===> lightness/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $lightness: 120%)} + +<===> lightness/out_of_range/output.css +a { + b: color-mix(in lch, color(xyz 1.6569354424 1.6040925936 1.5400032443) 100%, black); +} + +<===> +================================================================================ +<===> chroma/unitless/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $chroma: 50)} + +<===> chroma/unitless/output.css +a { + b: lch(50% 50 30deg); +} + +<===> +================================================================================ +<===> chroma/percent/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $chroma: 40%)} + +<===> chroma/percent/output.css +a { + b: lch(50% 60 30deg); +} + +<===> +================================================================================ +<===> chroma/negative/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $chroma: -10)} + +<===> chroma/negative/output.css +a { + b: lch(50% 10 210deg); +} + +<===> +================================================================================ +<===> chroma/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $chroma: 200)} + +<===> chroma/out_of_range/output.css +a { + b: lch(50% 200 30deg); +} + +<===> +================================================================================ +<===> hue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $hue: 50deg)} + +<===> hue/unitless/output.css +a { + b: lch(50% 20 50deg); +} + +<===> +================================================================================ +<===> hue/negative/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $hue: -20deg)} + +<===> hue/negative/output.css +a { + b: lch(50% 20 340deg); +} + +<===> +================================================================================ +<===> hue/above_max/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $hue: 400deg)} + +<===> hue/above_max/output.css +a { + b: lch(50% 20 40deg); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $lightness: 20%, $chroma: 30, $hue: 40deg)} + +<===> all/output.css +a { + b: lch(20% 30 40deg); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg / 0.9), $lightness: 30%)} + +<===> alpha_input/output.css +a { + b: lch(30% 20 30deg / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(lch(50% 20 30deg), $lightness: 30%, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: lch(30% 20 30deg / 0.9); +} diff --git a/spec/core_functions/color/change/no_channels.hrx b/spec/core_functions/color/change/no_channels.hrx new file mode 100644 index 0000000000..f59b2e6437 --- /dev/null +++ b/spec/core_functions/color/change/no_channels.hrx @@ -0,0 +1,19 @@ +<===> identical/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 0deg), $space: lab)} + +<===> identical/output.css +a { + b: oklch(50% 0.2 0deg); +} + +<===> +================================================================================ +<===> powerless/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0 0deg), $space: lab)} + +<===> powerless/output.css +a { + b: oklch(50% 0 none); +} diff --git a/spec/core_functions/color/change/no_space.hrx b/spec/core_functions/color/change/no_space.hrx new file mode 100644 index 0000000000..3cf8d754d7 --- /dev/null +++ b/spec/core_functions/color/change/no_space.hrx @@ -0,0 +1,131 @@ +<===> positional/input.scss +@use 'sass:color'; +a {b: color.change(red)} + +<===> positional/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> named/input.scss +@use 'sass:color'; +a {b: color.change($color: red)} + +<===> named/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> non_legacy/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 50 50))} + +<===> non_legacy/output.css +a { + b: lab(50% 50 50); +} + +<===> +================================================================================ +<===> alpha/max/input.scss +@use 'sass:color'; +a {b: color.change(rgba(red, 0.5), $alpha: 1)} + +<===> alpha/max/output.css +a { + b: red; +} + +<===> +================================================================================ +<===> alpha/min/input.scss +@use 'sass:color'; +a {b: color.change(rgba(red, 0.5), $alpha: 0)} + +<===> alpha/min/output.css +a { + b: rgba(255, 0, 0, 0); +} + +<===> +================================================================================ +<===> alpha/high/input.scss +@use 'sass:color'; +a {b: color.change(rgba(red, 0.5), $alpha: 0.72)} + +<===> alpha/high/output.css +a { + b: rgba(255, 0, 0, 0.72); +} + +<===> +================================================================================ +<===> alpha/low/input.scss +@use 'sass:color'; +a {b: color.change(rgba(red, 0.5), $alpha: 0.36)} + +<===> alpha/low/output.css +a { + b: rgba(255, 0, 0, 0.36); +} + +<===> +================================================================================ +<===> alpha/non_legacy/input.scss +@use 'sass:color'; +a {b: color.change(lab(50% 50 50), $alpha: 0.36)} + +<===> alpha/non_legacy/output.css +a { + b: lab(50% 50 50 / 0.36); +} + +<===> +================================================================================ +<===> alpha/units/unitless/input.scss +@use 'sass:color'; +a {b: color.change(red, $alpha: 0.5)} + +<===> alpha/units/unitless/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> alpha/units/percent/input.scss +@use 'sass:color'; +a {b: color.change(red, $alpha: 50%)} + +<===> alpha/units/percent/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> +================================================================================ +<===> alpha/units/unknown/input.scss +@use 'sass:color'; +a {b: color.change(red, $alpha: 0.5px)} + +<===> alpha/units/unknown/output.css +a { + b: rgba(255, 0, 0, 0.5); +} + +<===> alpha/units/unknown/warning +DEPRECATION WARNING: $alpha: Passing a unit other than % (0.5px) is deprecated. + +To preserve current behavior: calc($alpha / 1px) + +See https://sass-lang.com/d/function-units + + , +2 | a {b: color.change(red, $alpha: 0.5px)} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ' + input.scss 2:7 root stylesheet diff --git a/spec/core_functions/color/change/oklab.hrx b/spec/core_functions/color/change/oklab.hrx new file mode 100644 index 0000000000..dc3efa1d4f --- /dev/null +++ b/spec/core_functions/color/change/oklab.hrx @@ -0,0 +1,129 @@ +<===> lightness/unitless/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 0.3)} + +<===> lightness/unitless/output.css +a { + b: oklab(30% 0.2 -0.3); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 30%)} + +<===> lightness/percent/output.css +a { + b: oklab(30% 0.2 -0.3); +} + +<===> +================================================================================ +<===> lightness/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 1.2)} + +<===> lightness/out_of_range/output.css +a { + b: color-mix(in oklab, color(xyz 2.3267923962 1.5626810194 5.2743259015) 100%, black); +} + +<===> +================================================================================ +<===> a/unitless/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $a: 0.1)} + +<===> a/unitless/output.css +a { + b: oklab(50% 0.1 -0.3); +} + +<===> +================================================================================ +<===> a/percent/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $a: -40%)} + +<===> a/percent/output.css +a { + b: oklab(50% -0.16 -0.3); +} + +<===> +================================================================================ +<===> a/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $a: 1)} + +<===> a/out_of_range/output.css +a { + b: oklab(50% 1 -0.3); +} + +<===> +================================================================================ +<===> b/unitless/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $b: 0.4)} + +<===> b/unitless/output.css +a { + b: oklab(50% 0.2 0.4); +} + +<===> +================================================================================ +<===> b/percent/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $b: -40%)} + +<===> b/percent/output.css +a { + b: oklab(50% 0.2 -0.16); +} + +<===> +================================================================================ +<===> b/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $b: -1)} + +<===> b/out_of_range/output.css +a { + b: oklab(50% 0.2 -1); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 20%, $a: -0.3, $b: 0.4)} + +<===> all/output.css +a { + b: oklab(20% -0.3 0.4); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3 / 0.9), $lightness: 30%)} + +<===> alpha_input/output.css +a { + b: oklab(30% 0.2 -0.3 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(oklab(50% 0.2 -0.3), $lightness: 30%, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: oklab(30% 0.2 -0.3 / 0.9); +} diff --git a/spec/core_functions/color/change/oklch.hrx b/spec/core_functions/color/change/oklch.hrx new file mode 100644 index 0000000000..2eecf61da8 --- /dev/null +++ b/spec/core_functions/color/change/oklch.hrx @@ -0,0 +1,140 @@ +<===> lightness/unitless/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 0.3)} + +<===> lightness/unitless/output.css +a { + b: oklch(30% 0.2 30deg); +} + +<===> +================================================================================ +<===> lightness/percent/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 30%)} + +<===> lightness/percent/output.css +a { + b: oklch(30% 0.2 30deg); +} + +<===> +================================================================================ +<===> lightness/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 120%)} + +<===> lightness/out_of_range/output.css +a { + b: color-mix(in oklch, color(xyz 2.0602078346 1.6344742217 1.0169251403) 100%, black); +} + +<===> +================================================================================ +<===> chroma/unitless/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: 0.1)} + +<===> chroma/unitless/output.css +a { + b: oklch(50% 0.1 30deg); +} + +<===> +================================================================================ +<===> chroma/percent/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: 40%)} + +<===> chroma/percent/output.css +a { + b: oklch(50% 0.16 30deg); +} + +<===> +================================================================================ +<===> chroma/negative/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: -0.1)} + +<===> chroma/negative/output.css +a { + b: oklch(50% 0.1 210deg); +} + +<===> +================================================================================ +<===> chroma/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $chroma: 1)} + +<===> chroma/out_of_range/output.css +a { + b: oklch(50% 1 30deg); +} + +<===> +================================================================================ +<===> hue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $hue: 50deg)} + +<===> hue/unitless/output.css +a { + b: oklch(50% 0.2 50deg); +} + +<===> +================================================================================ +<===> hue/negative/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $hue: -20deg)} + +<===> hue/negative/output.css +a { + b: oklch(50% 0.2 340deg); +} + +<===> +================================================================================ +<===> hue/above_max/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $hue: 400deg)} + +<===> hue/above_max/output.css +a { + b: oklch(50% 0.2 40deg); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 20%, $chroma: 0.1, $hue: 40deg)} + +<===> all/output.css +a { + b: oklch(20% 0.1 40deg); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg / 0.9), $lightness: 30%)} + +<===> alpha_input/output.css +a { + b: oklch(30% 0.2 30deg / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(oklch(50% 0.2 30deg), $lightness: 30%, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: oklch(30% 0.2 30deg / 0.9); +} diff --git a/spec/core_functions/color/change/prophoto_rgb.hrx b/spec/core_functions/color/change/prophoto_rgb.hrx new file mode 100644 index 0000000000..1d5238beff --- /dev/null +++ b/spec/core_functions/color/change/prophoto_rgb.hrx @@ -0,0 +1,129 @@ +<===> red/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(prophoto-rgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(prophoto-rgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(prophoto-rgb 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(prophoto-rgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(prophoto-rgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(prophoto-rgb 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(prophoto-rgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(prophoto-rgb 0.2 0.5 100); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(prophoto-rgb 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(prophoto-rgb 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(color(prophoto-rgb 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(prophoto-rgb 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/rec2020.hrx b/spec/core_functions/color/change/rec2020.hrx new file mode 100644 index 0000000000..da2c37c239 --- /dev/null +++ b/spec/core_functions/color/change/rec2020.hrx @@ -0,0 +1,129 @@ +<===> red/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(rec2020 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(rec2020 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(rec2020 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(rec2020 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(rec2020 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(rec2020 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(rec2020 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(rec2020 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(rec2020 0.2 0.5 100); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(rec2020 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(rec2020 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(color(rec2020 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(rec2020 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change_color/rgb.hrx b/spec/core_functions/color/change/rgb.hrx similarity index 58% rename from spec/core_functions/color/change_color/rgb.hrx rename to spec/core_functions/color/change/rgb.hrx index b418953047..f63eb720a6 100644 --- a/spec/core_functions/color/change_color/rgb.hrx +++ b/spec/core_functions/color/change/rgb.hrx @@ -1,5 +1,6 @@ <===> red/max/input.scss -a {b: change-color(black, $red: 255)} +@use 'sass:color'; +a {b: color.change(black, $red: 255)} <===> red/max/output.css a { @@ -9,7 +10,8 @@ a { <===> ================================================================================ <===> red/min/input.scss -a {b: change-color(red, $red: 0)} +@use 'sass:color'; +a {b: color.change(red, $red: 0)} <===> red/min/output.css a { @@ -19,7 +21,8 @@ a { <===> ================================================================================ <===> red/low/input.scss -a {b: change-color(red, $red: 100)} +@use 'sass:color'; +a {b: color.change(red, $red: 100)} <===> red/low/output.css a { @@ -29,17 +32,30 @@ a { <===> ================================================================================ <===> red/high/input.scss -a {b: change-color(black, $red: 200)} +@use 'sass:color'; +a {b: color.change(black, $red: 200)} <===> red/high/output.css a { b: #c80000; } +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(black, $red: 500)} + +<===> red/out_of_range/output.css +a { + b: hsl(0, 5000%, 98.0392156863%); +} + <===> ================================================================================ <===> green/max/input.scss -a {b: change-color(black, $green: 255)} +@use 'sass:color'; +a {b: color.change(black, $green: 255)} <===> green/max/output.css a { @@ -49,7 +65,8 @@ a { <===> ================================================================================ <===> green/min/input.scss -a {b: change-color(lime, $green: 0)} +@use 'sass:color'; +a {b: color.change(lime, $green: 0)} <===> green/min/output.css a { @@ -59,7 +76,8 @@ a { <===> ================================================================================ <===> green/low/input.scss -a {b: change-color(lime, $green: 100)} +@use 'sass:color'; +a {b: color.change(lime, $green: 100)} <===> green/low/output.css a { @@ -69,17 +87,30 @@ a { <===> ================================================================================ <===> green/high/input.scss -a {b: change-color(black, $green: 200)} +@use 'sass:color'; +a {b: color.change(black, $green: 200)} <===> green/high/output.css a { b: #00c800; } +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(black, $green: -50)} + +<===> green/out_of_range/output.css +a { + b: hsl(120, 100%, -9.8039215686%); +} + <===> ================================================================================ <===> blue/max/input.scss -a {b: change-color(black, $blue: 255)} +@use 'sass:color'; +a {b: color.change(black, $blue: 255)} <===> blue/max/output.css a { @@ -89,7 +120,8 @@ a { <===> ================================================================================ <===> blue/min/input.scss -a {b: change-color(blue, $blue: 0)} +@use 'sass:color'; +a {b: color.change(blue, $blue: 0)} <===> blue/min/output.css a { @@ -99,7 +131,8 @@ a { <===> ================================================================================ <===> blue/low/input.scss -a {b: change-color(blue, $blue: 100)} +@use 'sass:color'; +a {b: color.change(blue, $blue: 100)} <===> blue/low/output.css a { @@ -109,17 +142,30 @@ a { <===> ================================================================================ <===> blue/high/input.scss -a {b: change-color(black, $blue: 200)} +@use 'sass:color'; +a {b: color.change(black, $blue: 200)} <===> blue/high/output.css a { b: #0000c8; } +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(black, $blue: 256)} + +<===> blue/out_of_range/output.css +a { + b: hsl(240, 100.7874015748%, 50.1960784314%); +} + <===> ================================================================================ <===> all/input.scss -a {b: change-color(black, $red: 12, $green: 24, $blue: 48)} +@use 'sass:color'; +a {b: color.change(black, $red: 12, $green: 24, $blue: 48)} <===> all/output.css a { @@ -129,7 +175,8 @@ a { <===> ================================================================================ <===> alpha_input/input.scss -a {b: change-color(rgba(black, 0.3), $red: 12, $green: 24, $blue: 48)} +@use 'sass:color'; +a {b: color.change(rgba(black, 0.3), $red: 12, $green: 24, $blue: 48)} <===> alpha_input/output.css a { @@ -139,7 +186,8 @@ a { <===> ================================================================================ <===> alpha_arg/input.scss -a {b: change-color(black, $red: 12, $green: 24, $blue: 48, $alpha: 0.3)} +@use 'sass:color'; +a {b: color.change(black, $red: 12, $green: 24, $blue: 48, $alpha: 0.3)} <===> alpha_arg/output.css a { @@ -149,7 +197,8 @@ a { <===> ================================================================================ <===> named/input.scss -a {b: change-color($color: black, $red: 12, $green: 24, $blue: 48)} +@use 'sass:color'; +a {b: color.change($color: black, $red: 12, $green: 24, $blue: 48)} <===> named/output.css a { diff --git a/spec/core_functions/color/change/srgb.hrx b/spec/core_functions/color/change/srgb.hrx new file mode 100644 index 0000000000..e7f123f344 --- /dev/null +++ b/spec/core_functions/color/change/srgb.hrx @@ -0,0 +1,129 @@ +<===> red/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(srgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(srgb 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(srgb 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(srgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(srgb 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(srgb 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(srgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(srgb 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(srgb 0.2 0.5 100); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(srgb 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(srgb 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(srgb 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/srgb_linear.hrx b/spec/core_functions/color/change/srgb_linear.hrx new file mode 100644 index 0000000000..2be5195196 --- /dev/null +++ b/spec/core_functions/color/change/srgb_linear.hrx @@ -0,0 +1,129 @@ +<===> red/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.5)} + +<===> red/unitless/output.css +a { + b: color(srgb-linear 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 50%)} + +<===> red/percent/output.css +a { + b: color(srgb-linear 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> red/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 1.2)} + +<===> red/out_of_range/output.css +a { + b: color(srgb-linear 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> green/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: 0.4)} + +<===> green/unitless/output.css +a { + b: color(srgb-linear 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: 40%)} + +<===> green/percent/output.css +a { + b: color(srgb-linear 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> green/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $green: -0.2)} + +<===> green/out_of_range/output.css +a { + b: color(srgb-linear 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> blue/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 0.5)} + +<===> blue/unitless/output.css +a { + b: color(srgb-linear 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 50%)} + +<===> blue/percent/output.css +a { + b: color(srgb-linear 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> blue/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $blue: 100)} + +<===> blue/out_of_range/output.css +a { + b: color(srgb-linear 0.2 0.5 100); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.7, $green: 0.4, $blue: 0.2)} + +<===> all/output.css +a { + b: color(srgb-linear 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7 / 0.9), $red: 0.5)} + +<===> alpha_input/output.css +a { + b: color(srgb-linear 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(color(srgb-linear 0.2 0.5 0.7), $red: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(srgb-linear 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/xyz.hrx b/spec/core_functions/color/change/xyz.hrx new file mode 100644 index 0000000000..1cd1f05d76 --- /dev/null +++ b/spec/core_functions/color/change/xyz.hrx @@ -0,0 +1,129 @@ +<===> x/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.5)} + +<===> x/unitless/output.css +a { + b: color(xyz 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> x/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 50%)} + +<===> x/percent/output.css +a { + b: color(xyz 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> x/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 1.2)} + +<===> x/out_of_range/output.css +a { + b: color(xyz 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> y/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: 0.4)} + +<===> y/unitless/output.css +a { + b: color(xyz 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> y/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: 40%)} + +<===> y/percent/output.css +a { + b: color(xyz 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> y/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $y: -0.2)} + +<===> y/out_of_range/output.css +a { + b: color(xyz 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> z/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 0.5)} + +<===> z/unitless/output.css +a { + b: color(xyz 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> z/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 50%)} + +<===> z/percent/output.css +a { + b: color(xyz 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> z/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $z: 100)} + +<===> z/out_of_range/output.css +a { + b: color(xyz 0.2 0.5 100); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.7, $y: 0.4, $z: 0.2)} + +<===> all/output.css +a { + b: color(xyz 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7 / 0.9), $x: 0.5)} + +<===> alpha_input/output.css +a { + b: color(xyz 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz 0.2 0.5 0.7), $x: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(xyz 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change/xyz_d50.hrx b/spec/core_functions/color/change/xyz_d50.hrx new file mode 100644 index 0000000000..6ef7951da4 --- /dev/null +++ b/spec/core_functions/color/change/xyz_d50.hrx @@ -0,0 +1,129 @@ +<===> x/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.5)} + +<===> x/unitless/output.css +a { + b: color(xyz-d50 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> x/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 50%)} + +<===> x/percent/output.css +a { + b: color(xyz-d50 0.5 0.5 0.7); +} + +<===> +================================================================================ +<===> x/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 1.2)} + +<===> x/out_of_range/output.css +a { + b: color(xyz-d50 1.2 0.5 0.7); +} + +<===> +================================================================================ +<===> y/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: 0.4)} + +<===> y/unitless/output.css +a { + b: color(xyz-d50 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> y/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: 40%)} + +<===> y/percent/output.css +a { + b: color(xyz-d50 0.2 0.4 0.7); +} + +<===> +================================================================================ +<===> y/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $y: -0.2)} + +<===> y/out_of_range/output.css +a { + b: color(xyz-d50 0.2 -0.2 0.7); +} + +<===> +================================================================================ +<===> z/unitless/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 0.5)} + +<===> z/unitless/output.css +a { + b: color(xyz-d50 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> z/percent/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 50%)} + +<===> z/percent/output.css +a { + b: color(xyz-d50 0.2 0.5 0.5); +} + +<===> +================================================================================ +<===> z/out_of_range/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $z: 100)} + +<===> z/out_of_range/output.css +a { + b: color(xyz-d50 0.2 0.5 100); +} + +<===> +================================================================================ +<===> all/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.7, $y: 0.4, $z: 0.2)} + +<===> all/output.css +a { + b: color(xyz-d50 0.7 0.4 0.2); +} + +<===> +================================================================================ +<===> alpha_input/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7 / 0.9), $x: 0.5)} + +<===> alpha_input/output.css +a { + b: color(xyz-d50 0.5 0.5 0.7 / 0.9); +} + +<===> +================================================================================ +<===> alpha_arg/input.scss +@use 'sass:color'; +a {b: color.change(color(xyz-d50 0.2 0.5 0.7), $x: 0.5, $alpha: 0.9)} + +<===> alpha_arg/output.css +a { + b: color(xyz-d50 0.5 0.5 0.7 / 0.9); +} diff --git a/spec/core_functions/color/change_color/error/bounds.hrx b/spec/core_functions/color/change_color/error/bounds.hrx deleted file mode 100644 index 6f5a2055c2..0000000000 --- a/spec/core_functions/color/change_color/error/bounds.hrx +++ /dev/null @@ -1,342 +0,0 @@ -<===> README.md -According to the new color space spec, out-of-bounds values should be allowed -(and clamped for strictly bounded spaces). See sass/sass-spec#1828. - -<===> options.yml ---- -:todo: -- dart-sass - -<===> -================================================================================ -<===> red/too_low/input.scss -a {b: change-color(red, $red: -1)} - -<===> red/too_low/error -Error: $red: Expected -1 to be within 0 and 255. - , -1 | a {b: change-color(red, $red: -1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> red/too_high/input.scss -a {b: change-color(red, $red: 256)} - -<===> red/too_high/error -Error: $red: Expected 256 to be within 0 and 255. - , -1 | a {b: change-color(red, $red: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> red/unit/input.scss -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: change-color(red, $red: 300px)} - -<===> red/unit/error -Error: $red: Expected 300px to be within 0 and 255. - , -3 | a {b: change-color(red, $red: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -<===> -================================================================================ -<===> green/too_low/input.scss -a {b: change-color(green, $green: -1)} - -<===> green/too_low/error -Error: $green: Expected -1 to be within 0 and 255. - , -1 | a {b: change-color(green, $green: -1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> green/too_high/input.scss -a {b: change-color(green, $green: 256)} - -<===> green/too_high/error -Error: $green: Expected 256 to be within 0 and 255. - , -1 | a {b: change-color(green, $green: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> green/unit/input.scss -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: change-color(green, $green: 300px)} - -<===> green/unit/error -Error: $green: Expected 300px to be within 0 and 255. - , -3 | a {b: change-color(green, $green: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -<===> -================================================================================ -<===> blue/too_low/input.scss -a {b: change-color(blue, $blue: -1)} - -<===> blue/too_low/error -Error: $blue: Expected -1 to be within 0 and 255. - , -1 | a {b: change-color(blue, $blue: -1)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> blue/too_high/input.scss -a {b: change-color(blue, $blue: 256)} - -<===> blue/too_high/error -Error: $blue: Expected 256 to be within 0 and 255. - , -1 | a {b: change-color(blue, $blue: 256)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> blue/unit/input.scss -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -a {b: change-color(blue, $blue: 300px)} - -<===> blue/unit/error -Error: $blue: Expected 300px to be within 0 and 255. - , -3 | a {b: change-color(blue, $blue: 300px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -<===> -================================================================================ -<===> saturation/too_low/input.scss -a {b: change-color(red, $saturation: -0.001%)} - -<===> saturation/too_low/error -Error: $saturation: Expected -0.001% to be within 0% and 100%. - , -1 | a {b: change-color(red, $saturation: -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> saturation/too_high/input.scss -a {b: change-color(red, $saturation: 100.001%)} - -<===> saturation/too_high/error -Error: $saturation: Expected 100.001% to be within 0% and 100%. - , -1 | a {b: change-color(red, $saturation: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> saturation/unit/input.scss -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -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: calc($saturation / 1px * 1%) - -More info: https://sass-lang.com/d/function-units - - , -3 | a {b: change-color(red, $saturation: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -Error: $saturation: Expected 200px to be within 0% and 100%. - , -3 | a {b: change-color(red, $saturation: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -<===> -================================================================================ -<===> lightness/too_low/input.scss -a {b: change-color(red, $lightness: -0.001%)} - -<===> lightness/too_low/error -Error: $lightness: Expected -0.001% to be within 0% and 100%. - , -1 | a {b: change-color(red, $lightness: -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> lightness/too_high/input.scss -a {b: change-color(red, $lightness: 100.001%)} - -<===> lightness/too_high/error -Error: $lightness: Expected 100.001% to be within 0% and 100%. - , -1 | a {b: change-color(red, $lightness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> lightness/unit/input.scss -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -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: calc($lightness / 1px * 1%) - -More info: https://sass-lang.com/d/function-units - - , -3 | a {b: change-color(red, $lightness: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -Error: $lightness: Expected 200px to be within 0% and 100%. - , -3 | a {b: change-color(red, $lightness: 200px)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -<===> -================================================================================ -<===> alpha/too_low/input.scss -a {b: change-color(red, $alpha: -0.001)} - -<===> alpha/too_low/error -Error: $alpha: Expected -0.001 to be within 0 and 1. - , -1 | a {b: change-color(red, $alpha: -0.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> alpha/too_high/input.scss -a {b: change-color(red, $alpha: 1.001)} - -<===> alpha/too_high/error -Error: $alpha: Expected 1.001 to be within 0 and 1. - , -1 | a {b: change-color(red, $alpha: 1.001)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> alpha/unit/input.scss -// This test covers sass/dart-sass#1745, but should be removed once units are -// fully forbidden (sass/sass#3374). -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%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 3:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_low/input.scss -a {b: change-color(red, $blackness: -0.001%)} - -<===> blackness/too_low/error -Error: $blackness: Expected -0.001% to be within 0% and 100%. - , -1 | a {b: change-color(red, $blackness: -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> blackness/too_high/input.scss -a {b: change-color(red, $blackness: 100.001%)} - -<===> blackness/too_high/error -Error: $blackness: Expected 100.001% to be within 0% and 100%. - , -1 | a {b: change-color(red, $blackness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_low/input.scss -a {b: change-color(red, $whiteness: -0.001%)} - -<===> whiteness/too_low/error -Error: $whiteness: Expected -0.001% to be within 0% and 100%. - , -1 | a {b: change-color(red, $whiteness: -0.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> whiteness/too_high/input.scss -a {b: change-color(red, $whiteness: 100.001%)} - -<===> whiteness/too_high/error -Error: $whiteness: Expected 100.001% to be within 0% and 100%. - , -1 | a {b: change-color(red, $whiteness: 100.001%)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet diff --git a/spec/core_functions/color/change_color/hsl.hrx b/spec/core_functions/color/change_color/hsl.hrx deleted file mode 100644 index b5c796e25c..0000000000 --- a/spec/core_functions/color/change_color/hsl.hrx +++ /dev/null @@ -1,187 +0,0 @@ -<===> hue/max/input.scss -a {b: change-color(red, $hue: 359)} - -<===> hue/max/output.css -a { - b: rgb(255, 0, 4.25); -} - -<===> -================================================================================ -<===> hue/above_max/input.scss -a {b: change-color(red, $hue: 540)} - -<===> hue/above_max/output.css -a { - b: aqua; -} - -<===> -================================================================================ -<===> hue/min/input.scss -a {b: change-color(blue, $hue: 0)} - -<===> hue/min/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> hue/negative/input.scss -a {b: change-color(red, $hue: -60)} - -<===> hue/negative/output.css -a { - b: fuchsia; -} - -<===> -================================================================================ -<===> hue/middle/input.scss -a {b: change-color(red, $hue: 123)} - -<===> hue/middle/output.css -a { - b: rgb(0, 255, 12.75); -} - -<===> -================================================================================ -<===> hue/fraction/input.scss -a {b: change-color(red, $hue: 0.5)} - -<===> hue/fraction/output.css -a { - b: rgb(255, 2.125, 0); -} - -<===> -================================================================================ -<===> saturation/max/input.scss -a {b: change-color(plum, $saturation: 100%)} - -<===> saturation/max/output.css -a { - b: #ff7eff; -} - -<===> -================================================================================ -<===> saturation/min/input.scss -a {b: change-color(plum, $saturation: 0%)} - -<===> saturation/min/output.css -a { - b: rgb(190.5, 190.5, 190.5); -} - -<===> -================================================================================ -<===> saturation/high/input.scss -a {b: change-color(plum, $saturation: 76%)} - -<===> saturation/high/output.css -a { - b: rgb(239.52, 141.48, 239.52); -} - -<===> -================================================================================ -<===> saturation/low/input.scss -a {b: change-color(plum, $saturation: 14%)} - -<===> saturation/low/output.css -a { - b: rgb(199.53, 181.47, 199.53); -} - -<===> -================================================================================ -<===> lightness/max/input.scss -a {b: change-color(red, $lightness: 100%)} - -<===> lightness/max/output.css -a { - b: white; -} - -<===> -================================================================================ -<===> lightness/fraction/input.scss -a {b: change-color(red, $lightness: 0.5%)} - -<===> lightness/fraction/output.css -a { - b: rgb(2.55, 0, 0); -} - -<===> -================================================================================ -<===> lightness/min/input.scss -a {b: change-color(red, $lightness: 0%)} - -<===> lightness/min/output.css -a { - b: black; -} - -<===> -================================================================================ -<===> lightness/high/input.scss -a {b: change-color(red, $lightness: 63%)} - -<===> lightness/high/output.css -a { - b: rgb(255, 66.3, 66.3); -} - -<===> -================================================================================ -<===> lightness/low/input.scss -a {b: change-color(red, $lightness: 27%)} - -<===> lightness/low/output.css -a { - b: rgb(137.7, 0, 0); -} - -<===> -================================================================================ -<===> all/input.scss -a {b: change-color(black, $hue: 12, $saturation: 24%, $lightness: 48%)} - -<===> all/output.css -a { - b: rgb(151.776, 104.7744, 93.024); -} - -<===> -================================================================================ -<===> alpha_input/input.scss -a {b: change-color(rgba(black, 0.7), $hue: 12, $saturation: 24%, $lightness: 48%)} - -<===> alpha_input/output.css -a { - b: rgba(151.776, 104.7744, 93.024, 0.7); -} - -<===> -================================================================================ -<===> alpha_arg/input.scss -a {b: change-color(black, $hue: 12, $saturation: 24%, $lightness: 48%, $alpha: 0.7)} - -<===> alpha_arg/output.css -a { - b: rgba(151.776, 104.7744, 93.024, 0.7); -} - -<===> -================================================================================ -<===> named/input.scss -a {b: change-color($color: black, $hue: 12, $saturation: 24%, $lightness: 48%)} - -<===> named/output.css -a { - b: rgb(151.776, 104.7744, 93.024); -} diff --git a/spec/core_functions/color/change_color/no_rgb_hsl.hrx b/spec/core_functions/color/change_color/no_rgb_hsl.hrx deleted file mode 100644 index 257b3c6d52..0000000000 --- a/spec/core_functions/color/change_color/no_rgb_hsl.hrx +++ /dev/null @@ -1,57 +0,0 @@ -<===> positional/input.scss -a {b: change-color(red)} - -<===> positional/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> named/input.scss -a {b: change-color($color: red)} - -<===> named/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> alpha/max/input.scss -a {b: change-color(rgba(red, 0.5), $alpha: 1)} - -<===> alpha/max/output.css -a { - b: red; -} - -<===> -================================================================================ -<===> alpha/min/input.scss -a {b: change-color(rgba(red, 0.5), $alpha: 0)} - -<===> alpha/min/output.css -a { - b: rgba(255, 0, 0, 0); -} - -<===> -================================================================================ -<===> alpha/high/input.scss -a {b: change-color(rgba(red, 0.5), $alpha: 0.72)} - -<===> alpha/high/output.css -a { - b: rgba(255, 0, 0, 0.72); -} - -<===> -================================================================================ -<===> alpha/low/input.scss -a {b: change-color(rgba(red, 0.5), $alpha: 0.36)} - -<===> alpha/low/output.css -a { - b: rgba(255, 0, 0, 0.36); -} diff --git a/spec/core_functions/color/change_color/units.hrx b/spec/core_functions/color/change_color/units.hrx deleted file mode 100644 index a4d23a1a96..0000000000 --- a/spec/core_functions/color/change_color/units.hrx +++ /dev/null @@ -1,218 +0,0 @@ -<===> hue/deg/input.scss -a {b: change-color(red, $hue: 60deg)} - -<===> hue/deg/output.css -a { - b: yellow; -} - -<===> -================================================================================ -<===> hue/unitless/input.scss -a {b: change-color(red, $hue: 60)} - -<===> hue/unitless/output.css -a { - b: yellow; -} - -<===> -================================================================================ -<===> hue/unknown/input.scss -a {b: change-color(red, $hue: 60in)} - -<===> hue/unknown/output.css -a { - b: yellow; -} - -<===> hue/unknown/warning -DEPRECATION WARNING: $hue: Passing a unit other than deg (60in) is deprecated. - -To preserve current behavior: calc($hue / 1in) - -See https://sass-lang.com/d/function-units - - , -1 | a {b: change-color(red, $hue: 60in)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> hue/angle/input.scss -a {b: change-color(red, $hue: 60rad)} - -<===> hue/angle/output.css -a { - b: rgb(0, 179.576224164, 255); -} - -<===> -================================================================================ -<===> saturation/percent/input.scss -a {b: change-color(red, $saturation: 50%)} - -<===> saturation/percent/output.css -a { - b: rgb(191.25, 63.75, 63.75); -} - -<===> -================================================================================ -<===> saturation/unitless/input.scss -a {b: change-color(red, $saturation: 50)} - -<===> saturation/unitless/output.css -a { - b: rgb(191.25, 63.75, 63.75); -} - -<===> saturation/unitless/warning -DEPRECATION WARNING: $saturation: Passing a number without unit % (50) is deprecated. - -To preserve current behavior: $saturation * 1% - -More info: https://sass-lang.com/d/function-units - - , -1 | a {b: change-color(red, $saturation: 50)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> saturation/unknown/input.scss -a {b: change-color(red, $saturation: 50in)} - -<===> saturation/unknown/output.css -a { - b: rgb(191.25, 63.75, 63.75); -} - -<===> saturation/unknown/warning -DEPRECATION WARNING: $saturation: Passing a number without unit % (50in) is deprecated. - -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)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> lightness/percent/input.scss -a {b: change-color(red, $lightness: 30%)} - -<===> lightness/percent/output.css -a { - b: #990000; -} - -<===> -================================================================================ -<===> lightness/unitless/input.scss -a {b: change-color(red, $lightness: 30)} - -<===> lightness/unitless/output.css -a { - b: #990000; -} - -<===> lightness/unitless/warning -DEPRECATION WARNING: $lightness: Passing a number without unit % (30) is deprecated. - -To preserve current behavior: $lightness * 1% - -More info: https://sass-lang.com/d/function-units - - , -1 | a {b: change-color(red, $lightness: 30)} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ' - input.scss 1:7 root stylesheet - -<===> -================================================================================ -<===> lightness/unknown/input.scss -a {b: change-color(red, $lightness: 30in)} - -<===> lightness/unknown/output.css -a { - b: #990000; -} - -<===> lightness/unknown/warning -DEPRECATION WARNING: $lightness: Passing a number without unit % (30in) is deprecated. - -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