-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Color 4] Add tests for color.to-space()
- Loading branch information
Showing
47 changed files
with
5,740 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<===> undefined_space/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#abc, c)} | ||
|
||
<===> undefined_space/error | ||
Error: $space: Unknown color space "c". | ||
, | ||
2 | a {b: color.to-space(#abc, c)} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 2:7 root stylesheet | ||
|
||
<===> | ||
================================================================================ | ||
<===> quoted_space/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#abc, "hsl")} | ||
|
||
<===> quoted_space/error | ||
Error: $space: Expected "hsl" to be an unquoted string. | ||
, | ||
2 | a {b: color.to-space(#abc, "hsl")} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 2:7 root stylesheet | ||
|
||
<===> | ||
================================================================================ | ||
<===> too_few_args/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#abc)} | ||
|
||
<===> too_few_args/error | ||
Error: Missing argument $space. | ||
,--> input.scss | ||
2 | a {b: color.to-space(#abc)} | ||
| ^^^^^^^^^^^^^^^^^^^^ invocation | ||
' | ||
,--> sass:color | ||
1 | @function to-space($color, $space) { | ||
| ======================== declaration | ||
' | ||
input.scss 2:7 root stylesheet | ||
|
||
<===> | ||
================================================================================ | ||
<===> too_many_args/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#abc, rgb, hsl)} | ||
|
||
<===> too_many_args/error | ||
Error: Only 2 arguments allowed, but 3 were passed. | ||
,--> input.scss | ||
2 | a {b: color.to-space(#abc, rgb, hsl)} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invocation | ||
' | ||
,--> sass:color | ||
1 | @function to-space($color, $space) { | ||
| ======================== declaration | ||
' | ||
input.scss 2:7 root stylesheet | ||
|
||
<===> | ||
================================================================================ | ||
<===> type/color/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(1, rgb)} | ||
|
||
<===> type/color/error | ||
Error: $color: 1 is not a color. | ||
, | ||
2 | a {b: color.to-space(1, rgb)} | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 2:7 root stylesheet | ||
|
||
<===> | ||
================================================================================ | ||
<===> type/space/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#abc, #def)} | ||
|
||
<===> type/space/error | ||
Error: $space: #def is not a string. | ||
, | ||
2 | a {b: color.to-space(#abc, #def)} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
' | ||
input.scss 2:7 root stylesheet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
:ignore_for: | ||
- libsass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<===> black/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#000, a98-rgb)} | ||
|
||
<===> black/output.css | ||
a { | ||
b: color(a98-rgb 0 0 0); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> white/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#fff, a98-rgb)} | ||
|
||
<===> white/output.css | ||
a { | ||
b: color(a98-rgb 1 1 1); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> gray/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#aaa, a98-rgb)} | ||
|
||
<===> gray/output.css | ||
a { | ||
b: color(a98-rgb 0.660735938 0.660735938 0.660735938); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> middle/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#28d, a98-rgb)} | ||
|
||
<===> middle/output.css | ||
a { | ||
b: color(a98-rgb 0.3199480242 0.5287075634 0.8521762133); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> float/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), a98-rgb)} | ||
|
||
<===> float/output.css | ||
a { | ||
b: color(a98-rgb 0.2781926905 0.395603604 0.7684686532); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> out_of_range/near/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(-50, 100, 400), a98-rgb)} | ||
|
||
<===> out_of_range/near/output.css | ||
a { | ||
b: color(a98-rgb 0.1411766693 0.3918977213 1.5718485866); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> out_of_range/far/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(-999999, 0, 0), a98-rgb)} | ||
|
||
<===> out_of_range/far/output.css | ||
a { | ||
b: color(a98-rgb -6760.0211192379 0 0); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> alpha/partial/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(10 20 30 / 0.4), a98-rgb)} | ||
|
||
<===> alpha/partial/output.css | ||
a { | ||
b: color(a98-rgb 0.0827079329 0.1047180692 0.1375163198 / 0.4); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> alpha/transparent/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(10 20 30 / 0.0), a98-rgb)} | ||
|
||
<===> alpha/transparent/output.css | ||
a { | ||
b: color(a98-rgb 0.0827079329 0.1047180692 0.1375163198 / 0); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> missing/red/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(none 20 30), a98-rgb)} | ||
|
||
<===> missing/red/output.css | ||
a { | ||
b: color(a98-rgb none 0.1047180692 0.1375163198); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> missing/green/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(10 none 30), a98-rgb)} | ||
|
||
<===> missing/green/output.css | ||
a { | ||
b: color(a98-rgb 0.0615069668 none 0.1360938515); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> missing/blue/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(10 20 none), a98-rgb)} | ||
|
||
<===> missing/blue/output.css | ||
a { | ||
b: color(a98-rgb 0.0827079329 0.1047180692 none); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
<===> black/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#000, display-p3)} | ||
|
||
<===> black/output.css | ||
a { | ||
b: color(display-p3 0 0 0); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> white/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#fff, display-p3)} | ||
|
||
<===> white/output.css | ||
a { | ||
b: color(display-p3 1 1 1); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> gray/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#aaa, display-p3)} | ||
|
||
<===> gray/output.css | ||
a { | ||
b: color(display-p3 0.6666666667 0.6666666667 0.6666666667); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> middle/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(#28d, display-p3)} | ||
|
||
<===> middle/output.css | ||
a { | ||
b: color(display-p3 0.2644791221 0.525654809 0.8414340148); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> float/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(50.123456789 100.987654321 200.192837465), display-p3)} | ||
|
||
<===> float/output.css | ||
a { | ||
b: color(display-p3 0.2464159945 0.3912935228 0.7592218197); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> out_of_range/near/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(-50, 100, 400), display-p3)} | ||
|
||
<===> out_of_range/near/output.css | ||
a { | ||
b: color(display-p3 -0.0462648785 0.3843286419 1.5086360967); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> out_of_range/far/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(-999999, 0, 0), display-p3)} | ||
|
||
<===> out_of_range/far/output.css | ||
a { | ||
b: color(display-p3 -3614.8515104566 -948.8907591358 -719.4436054746); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> alpha/partial/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(10 20 30 / 0.4), display-p3)} | ||
|
||
<===> alpha/partial/output.css | ||
a { | ||
b: color(display-p3 0.0477705982 0.0773808537 0.1142571507 / 0.4); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> alpha/transparent/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(10 20 30 / 0.0), display-p3)} | ||
|
||
<===> alpha/transparent/output.css | ||
a { | ||
b: color(display-p3 0.0477705982 0.0773808537 0.1142571507 / 0); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> missing/red/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(none 20 30), display-p3)} | ||
|
||
<===> missing/red/output.css | ||
a { | ||
b: color(display-p3 none 0.0765677073 0.1139614092); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> missing/green/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(10 none 30), display-p3)} | ||
|
||
<===> missing/green/output.css | ||
a { | ||
b: color(display-p3 0.0322534105 none 0.1113368327); | ||
} | ||
|
||
<===> | ||
================================================================================ | ||
<===> missing/blue/input.scss | ||
@use 'sass:color'; | ||
a {b: color.to-space(rgb(10 20 none), display-p3)} | ||
|
||
<===> missing/blue/output.css | ||
a { | ||
b: color(display-p3 0.0477705982 0.0773808537 none); | ||
} |
Oops, something went wrong.