Skip to content

Commit

Permalink
[Color 4] Fix remaining Dart Sass TODOs (#1992)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed May 10, 2024
1 parent a92cec7 commit 7e48831
Show file tree
Hide file tree
Showing 56 changed files with 478 additions and 732 deletions.
14 changes: 4 additions & 10 deletions spec/core_functions/color/hsl/one_arg/relative_color.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,13 @@ a {
b: hsl(from #aaa h s l / 25%);
}

<===>
================================================================================
<===> error/options.yml
:todo:
- dart-sass

<===>
================================================================================
<===> error/quoted/alpha/input.scss
a {b: hsl("from" #aaa h s l / 25%)}

<===> error/quoted/alpha/error
Error: Only 3 elements allowed, but 5 were passed.
Error: $channels: Expected hue channel to be a number, was "from".
,
1 | a {b: hsl("from" #aaa h s l / 25%)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -111,7 +105,7 @@ Error: Only 3 elements allowed, but 5 were passed.
a {b: hsl("from" #aaa h s l)}

<===> error/quoted/no_alpha/error
Error: Only 3 elements allowed, but 5 were passed.
Error: $channels: Expected hue channel to be a number, was "from".
,
1 | a {b: hsl("from" #aaa h s l)}
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -124,7 +118,7 @@ Error: Only 3 elements allowed, but 5 were passed.
a {b: hsl(c #aaa h s l / 25%)}

<===> error/wrong_keyword/alpha/error
Error: Only 3 elements allowed, but 5 were passed.
Error: $channels: Expected hue channel to be a number, was c.
,
1 | a {b: hsl(c #aaa h s l / 25%)}
| ^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -137,7 +131,7 @@ Error: Only 3 elements allowed, but 5 were passed.
a {b: hsl(c #aaa h s l)}

<===> error/wrong_keyword/no_alpha/error
Error: Only 3 elements allowed, but 5 were passed.
Error: $channels: Expected hue channel to be a number, was c.
,
1 | a {b: hsl(c #aaa h s l)}
| ^^^^^^^^^^^^^^^^^
Expand Down
28 changes: 14 additions & 14 deletions spec/core_functions/color/hsl/one_arg/special_functions/alpha.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ a {b: hsl(1 2% unquote("calc(3%)") / 0.4)}

<===> calc/string/arg_3/output.css
a {
b: hsl(1 2% calc(3%)/0.4);
b: hsl(1, 2%, calc(3%), 0.4);
}

<===>
Expand All @@ -33,7 +33,7 @@ a {b: hsl(1 2% 3% / unquote("calc(0.4)"))}

<===> calc/string/arg_4/output.css
a {
b: hsl(1 2% 3%/calc(0.4));
b: hsl(1, 2%, 3%, calc(0.4));
}

<===>
Expand Down Expand Up @@ -63,7 +63,7 @@ a {b: hsl(1 2% calc(1px + 1%) / 0.4)}

<===> calc/calculation/arg_3/output.css
a {
b: hsl(1 2% calc(1px + 1%)/0.4);
b: hsl(1, 2%, calc(1px + 1%), 0.4);
}

<===>
Expand All @@ -73,7 +73,7 @@ a {b: hsl(1 2% 3% / calc(1px + 1%))}

<===> calc/calculation/arg_4/output.css
a {
b: hsl(1 2% 3%/calc(1px + 1%));
b: hsl(1, 2%, 3%, calc(1px + 1%));
}

<===>
Expand Down Expand Up @@ -103,7 +103,7 @@ a {b: hsl(1 2% var(--foo) / 0.4)}

<===> var/arg_3/output.css
a {
b: hsl(1 2% var(--foo)/0.4);
b: hsl(1, 2%, var(--foo), 0.4);
}

<===>
Expand All @@ -113,7 +113,7 @@ a {b: hsl(1 2% 3% / var(--foo))}

<===> var/arg_4/output.css
a {
b: hsl(1 2% 3%/var(--foo));
b: hsl(1, 2%, 3%, var(--foo));
}

<===>
Expand Down Expand Up @@ -143,7 +143,7 @@ a {b: hsl(1 2% env(--foo) / 0.4)}

<===> env/arg_3/output.css
a {
b: hsl(1 2% env(--foo)/0.4);
b: hsl(1, 2%, env(--foo), 0.4);
}

<===>
Expand All @@ -153,7 +153,7 @@ a {b: hsl(1 2% 3% / env(--foo))}

<===> env/arg_4/output.css
a {
b: hsl(1 2% 3%/env(--foo));
b: hsl(1, 2%, 3%, env(--foo));
}

<===>
Expand Down Expand Up @@ -183,7 +183,7 @@ a {b: hsl(1 2% unquote("min(3%)") / 0.4)}

<===> min/string/arg_3/output.css
a {
b: hsl(1 2% min(3%)/0.4);
b: hsl(1, 2%, min(3%), 0.4);
}

<===>
Expand All @@ -193,7 +193,7 @@ a {b: hsl(1 2% 3% / unquote("min(0.4)"))}

<===> min/string/arg_4/output.css
a {
b: hsl(1 2% 3%/min(0.4));
b: hsl(1, 2%, 3%, min(0.4));
}

<===>
Expand Down Expand Up @@ -223,7 +223,7 @@ a {b: hsl(1 2% unquote("max(3%)") / 0.4)}

<===> max/string/arg_3/output.css
a {
b: hsl(1 2% max(3%)/0.4);
b: hsl(1, 2%, max(3%), 0.4);
}

<===>
Expand All @@ -233,7 +233,7 @@ a {b: hsl(1 2% 3% / unquote("max(0.4)"))}

<===> max/string/arg_4/output.css
a {
b: hsl(1 2% 3%/max(0.4));
b: hsl(1, 2%, 3%, max(0.4));
}

<===>
Expand Down Expand Up @@ -263,7 +263,7 @@ a {b: hsl(1 2% unquote("clamp(3%, 4%, 5%)") / 0.4)}

<===> clamp/string/arg_3/output.css
a {
b: hsl(1 2% clamp(3%, 4%, 5%)/0.4);
b: hsl(1, 2%, clamp(3%, 4%, 5%), 0.4);
}

<===>
Expand All @@ -273,7 +273,7 @@ a {b: hsl(1 2% 3% / unquote("clamp(0.4, 0.5, 0.6)"))}

<===> clamp/string/arg_4/output.css
a {
b: hsl(1 2% 3%/clamp(0.4, 0.5, 0.6));
b: hsl(1, 2%, 3%, clamp(0.4, 0.5, 0.6));
}

<===>
Expand Down
152 changes: 0 additions & 152 deletions spec/core_functions/color/hwb/error/four_args.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,6 @@ Error: Expected hue channel to be a number, was "foo".
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> hue/var/options.yml
---
:todo:
- dart-sass

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

<===> hue/var/error
Error: $hue: var(--c) is not a number.
,
2 | a {b: color.hwb(var(--c), 30%, 40%, 0.5)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> whiteness/type/input.scss
Expand Down Expand Up @@ -71,63 +52,6 @@ Error: $whiteness: Expected 30px to have unit "%".
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> whiteness/too_high/options.yml
---
:todo:
- dart-sass

<===> whiteness/too_high/input.scss
@use 'sass:color';
a {b: color.hwb(0, 101%, 40%, 0.5)}

<===> whiteness/too_high/error
Error: $whiteness: Expected 101% to be within 0% and 100%.
,
2 | a {b: color.hwb(0, 101%, 40%, 0.5)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> whiteness/too_low/options.yml
---
:todo:
- dart-sass

<===> whiteness/too_low/input.scss
@use 'sass:color';
a {b: color.hwb(0, -1%, 40%, 0.5)}

<===> whiteness/too_low/error
Error: $whiteness: Expected -1% to be within 0% and 100%.
,
2 | a {b: color.hwb(0, -1%, 40%, 0.5)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> whiteness/var/options.yml
---
:todo:
- dart-sass

<===> whiteness/var/input.scss
@use 'sass:color';
a {b: color.hwb(0, var(--c), 40%, 0.5)}

<===> whiteness/var/error
Error: $whiteness: var(--c) is not a number.
,
2 | a {b: color.hwb(0, var(--c), 40%, 0.5)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> blackness/type/input.scss
Expand Down Expand Up @@ -170,63 +94,6 @@ Error: $blackness: Expected 40px to have unit "%".
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> blackness/too_high/options.yml
---
:todo:
- dart-sass

<===> blackness/too_high/input.scss
@use 'sass:color';
a {b: color.hwb(0, 30%, 101%, 0.5)}

<===> blackness/too_high/error
Error: $blackness: Expected 101% to be within 0% and 100%.
,
2 | a {b: color.hwb(0, 30%, 101%, 0.5)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> blackness/too_low/options.yml
---
:todo:
- dart-sass

<===> blackness/too_low/input.scss
@use 'sass:color';
a {b: color.hwb(0, 30%, -1%, 0.5)}

<===> blackness/too_low/error
Error: $blackness: Expected -1% to be within 0% and 100%.
,
2 | a {b: color.hwb(0, 30%, -1%, 0.5)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> blackness/var/options.yml
---
:todo:
- dart-sass

<===> blackness/var/input.scss
@use 'sass:color';
a {b: color.hwb(0, 30%, var(--c), 0.5)}

<===> blackness/var/error
Error: $blackness: var(--c) is not a number.
,
2 | a {b: color.hwb(0, 30%, var(--c), 0.5)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> alpha/unit/input.scss
Expand All @@ -240,22 +107,3 @@ Error: $alpha: Expected 0.5px to have unit "%" or no units.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> alpha/var/options.yml
---
:todo:
- dart-sass

<===> alpha/var/input.scss
@use 'sass:color';
a {b: color.hwb(0, 0%, 0%, var(--c))}

<===> alpha/var/error
Error: $alpha: var(--c) is not a number.
,
2 | a {b: color.hwb(0, 0%, 0%, var(--c))}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 2:7 root stylesheet
Loading

0 comments on commit 7e48831

Please sign in to comment.