Skip to content

Commit

Permalink
Re-enable and expand tests for relative colors (#1947)
Browse files Browse the repository at this point in the history
See #3673
  • Loading branch information
nex3 committed Oct 10, 2023
1 parent 554a03a commit 248e915
Show file tree
Hide file tree
Showing 6 changed files with 345 additions and 15 deletions.
13 changes: 6 additions & 7 deletions spec/core_functions/color/hsl/one_arg/relative_color.hrx
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<===> options.yml
:todo:
- dart-sass

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

Expand Down Expand Up @@ -61,7 +55,6 @@ a {
b: hsl(from var(--c) h s l);
}


<===>
================================================================================
<===> different_case/alpha/input.scss
Expand Down Expand Up @@ -93,6 +86,12 @@ a {
b: hsl(from #aaa h s l / 25%);
}

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

<===>
================================================================================
<===> error/quoted/alpha/input.scss
Expand Down
148 changes: 148 additions & 0 deletions spec/core_functions/color/hwb/one_arg.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,151 @@ a {b: color.hwb($channels: 180 30% 40% / 0.4)}
a {
b: hsla(180, 33.3333333333%, 45%, 0.4);
}

<===>
================================================================================
<===> relative_color/static/alpha/input.scss
a {b: hwb(from #aaa h w b / 25%)}

<===> relative_color/static/alpha/output.css
a {
b: hwb(from #aaa h w b/25%);
}

<===>
================================================================================
<===> relative_color/static/no_alpha/input.scss
a {b: hwb(from #aaa h w b)}

<===> relative_color/static/no_alpha/output.css
a {
b: hwb(from #aaa h w b);
}

<===>
================================================================================
<===> relative_color/calc/alpha/input.scss
a {b: hwb(from #aaa calc(h + 180deg) w b / 25%)}

<===> relative_color/calc/alpha/output.css
a {
b: hwb(from #aaa calc(h + 180deg) w b/25%);
}

<===>
================================================================================
<===> relative_color/calc/no_alpha/input.scss
a {b: hwb(from #aaa calc(h + 180deg) w b)}

<===> relative_color/calc/no_alpha/output.css
a {
b: hwb(from #aaa calc(h + 180deg) w b);
}

<===>
================================================================================
<===> relative_color/var/alpha/input.scss
a {b: hwb(from var(--c) h w b / 25%)}

<===> relative_color/var/alpha/output.css
a {
b: hwb(from var(--c) h w b/25%);
}

<===>
================================================================================
<===> relative_color/var/no_alpha/input.scss
a {b: hwb(from var(--c) h w b)}
<===> relative_color/var/no_alpha/output.css
a {
b: hwb(from var(--c) h w b);
}

<===>
================================================================================
<===> relative_color/different_case/alpha/input.scss
a {b: hwb(From #aaa h w b / 25%)}

<===> relative_color/different_case/alpha/output.css
a {
b: hwb(From #aaa h w b/25%);
}

<===>
================================================================================
<===> relative_color/different_case/no_alpha/input.scss
a {b: hwb(From #aaa h w b)}

<===> relative_color/different_case/no_alpha/output.css
a {
b: hwb(From #aaa h w b);
}

<===>
================================================================================
<===> relative_color/slash_list_alpha/input.scss
@use "sass:list";
a {b: hwb(list.slash(from #aaa h w b, 25%))}

<===> relative_color/slash_list_alpha/output.css
a {
b: hwb(from #aaa h w b / 25%);
}

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

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

<===> relative_color/error/quoted/alpha/error
Error: Only 3 elements allowed, but 5 were passed.
,
1 | a {b: hwb("from" #aaa h w b / 25%)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> relative_color/error/quoted/no_alpha/input.scss
a {b: hwb("from" #aaa h w b)}

<===> relative_color/error/quoted/no_alpha/error
Error: Only 3 elements allowed, but 5 were passed.
,
1 | a {b: hwb("from" #aaa h w b)}
| ^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> relative_color/error/wrong_keyword/alpha/input.scss
a {b: hwb(c #aaa h w b / 25%)}

<===> relative_color/error/wrong_keyword/alpha/error
Error: Only 3 elements allowed, but 5 were passed.
,
1 | a {b: hwb(c #aaa h w b / 25%)}
| ^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> relative_color/error/wrong_keyword/no_alpha/input.scss
a {b: hwb(c #aaa h w b)}

<===> relative_color/error/wrong_keyword/no_alpha/error
Error: Only 3 elements allowed, but 5 were passed.
,
1 | a {b: hwb(c #aaa h w b)}
| ^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet
146 changes: 146 additions & 0 deletions spec/core_functions/color/lab/relative_color.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<===> static/alpha/input.scss
a {b: lab(from #aaa l a b / 25%)}

<===> static/alpha/output.css
a {
b: lab(from #aaa l a b/25%);
}

<===>
================================================================================
<===> static/no_alpha/input.scss
a {b: lab(from #aaa l a b)}

<===> static/no_alpha/output.css
a {
b: lab(from #aaa l a b);
}

<===>
================================================================================
<===> calc/alpha/input.scss
a {b: lab(from #aaa calc(l + 0.2) a b / 25%)}

<===> calc/alpha/output.css
a {
b: lab(from #aaa calc(l + 0.2) a b/25%);
}

<===>
================================================================================
<===> calc/no_alpha/input.scss
a {b: lab(from #aaa calc(l + 0.2) a b)}

<===> calc/no_alpha/output.css
a {
b: lab(from #aaa calc(l + 0.2) a b);
}

<===>
================================================================================
<===> var/alpha/input.scss
a {b: lab(from var(--c) l a b / 25%)}

<===> var/alpha/output.css
a {
b: lab(from var(--c) l a b/25%);
}

<===>
================================================================================
<===> var/no_alpha/input.scss
a {b: lab(from var(--c) l a b)}

<===> var/no_alpha/output.css
a {
b: lab(from var(--c) l a b);
}

<===>
================================================================================
<===> different_case/alpha/input.scss
a {b: lab(From #aaa l a b / 25%)}

<===> different_case/alpha/output.css
a {
b: lab(From #aaa l a b/25%);
}

<===>
================================================================================
<===> different_case/no_alpha/input.scss
a {b: lab(From #aaa l a b)}

<===> different_case/no_alpha/output.css
a {
b: lab(From #aaa l a b);
}

<===>
================================================================================
<===> slash_list_alpha/input.scss
@use "sass:list";
a {b: lab(list.slash(from #aaa r g b, 25%))}

<===> slash_list_alpha/output.css
a {
b: lab(from #aaa r g b / 25%);
}

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

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

<===> error/quoted/alpha/error
Error: Only 3 elements allowed, but 5 were passed.
,
1 | a {b: lab("from" #aaa l a b / 25%)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> error/quoted/no_alpha/input.scss
a {b: lab("from" #aaa l a b)}

<===> error/quoted/no_alpha/error
Error: Only 3 elements allowed, but 5 were passed.
,
1 | a {b: lab("from" #aaa l a b)}
| ^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> error/wrong_keyword/alpha/input.scss
a {b: lab(c #aaa l a b / 25%)}

<===> error/wrong_keyword/alpha/error
Error: Only 3 elements allowed, but 5 were passed.
,
1 | a {b: lab(c #aaa l a b / 25%)}
| ^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> error/wrong_keyword/no_alpha/input.scss
a {b: lab(c #aaa l a b)}

<===> error/wrong_keyword/no_alpha/error
Error: Only 3 elements allowed, but 5 were passed.
,
1 | a {b: lab(c #aaa l a b)}
| ^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet
25 changes: 25 additions & 0 deletions spec/core_functions/color/oklab/alpha.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,28 @@ a {
value: oklab(1% 2 3 / none);
channels: 1% 2 3 / none;
}

<===>
================================================================================
<===> relative_color/slash/input.scss
@use 'core_functions/color/oklab/utils';
@include utils.inspect(oklab(from #aaa l a b / 25%));

<===> relative_color/slash/output.css
a {
value: oklab(from #aaa l a b/25%);
type: string;
}

<===>
================================================================================
<===> relative_color/slash_list/input.scss
@use 'sass:list';
@use 'core_functions/color/oklab/utils';
@include utils.inspect(oklab(list.slash(from #aaa l a b, 25%)));

<===> relative_color/slash_list/output.css
a {
value: oklab(from #aaa l a b / 25%);
type: string;
}
12 changes: 12 additions & 0 deletions spec/core_functions/color/oklab/no_alpha.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ a {
channels: 1% 2 none / 1;
}

<===>
================================================================================
<===> relative_color/input.scss
@use 'core_functions/color/oklab/utils';
@include utils.inspect(oklab(from #aaa l a b));

<===> relative_color/output.css
a {
value: oklab(from #aaa l a b);
type: string;
}

<===>
================================================================================
<===> named/input.scss
Expand Down
Loading

0 comments on commit 248e915

Please sign in to comment.