Skip to content

Commit

Permalink
Add specs for the support of relative CSS colors
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Sep 27, 2023
1 parent 756ef27 commit 81bee77
Show file tree
Hide file tree
Showing 2 changed files with 250 additions and 0 deletions.
125 changes: 125 additions & 0 deletions spec/core_functions/color/hsl/one_arg/relative_color.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<===> static/alpha/input.scss
a {b: hsl(from #aaa h s l / 25%)}

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

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

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

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

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

<===>
================================================================================
<===> calc/no_alpha/input.scss
a {b: hsl(from #aaa calc(h + 180deg) s l)}

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

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

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

<===>
================================================================================
<===> var/no_alpha/input.scss
a {b: hsl(from var(--c) h s l)}
<===> var/no_alpha/output.css
a {
b: hsl(from var(--c) h s l);
}


<===>
================================================================================
<===> different_case/alpha/input.scss
a {b: hsl(From #aaa h s l / 25%)}
<===> different_case/alpha/output.css
a {
b: hsl(From #aaa h s l/25%);
}

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

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

<===>
================================================================================
<===> 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.
,
1 | a {b: hsl("from" #aaa h s l / 25%)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

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

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

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

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

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

<===>
================================================================================
<===> static/no_alpha/input.scss
a {b: rgb(from #aaa r g b)}

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

<===>
================================================================================
<===> calc/alpha/input.scss
a {b: rgb(from #aaa calc(r + 2) g b / 25%)}

<===> calc/alpha/output.css
a {
b: rgb(from #aaa calc(r + 2) g b/25%);
}

<===>
================================================================================
<===> calc/no_alpha/input.scss
a {b: rgb(from #aaa calc(r + 2) g b)}

<===> calc/no_alpha/output.css
a {
b: rgb(from #aaa calc(r + 2) g b);
}

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

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

<===>
================================================================================
<===> var/no_alpha/input.scss
a {b: rgb(from var(--c) r g b)}
<===> var/no_alpha/output.css
a {
b: rgb(from var(--c) r g b);
}

<===>
================================================================================
<===> different_case/alpha/input.scss
a {b: rgb(From #aaa r g b / 25%)}
<===> different_case/alpha/output.css
a {
b: rgb(From #aaa r g b/25%);
}

<===>
================================================================================
<===> different_case/no_alpha/input.scss
a {b: rgb(From #aaa r g b)}

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

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

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

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

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

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

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

0 comments on commit 81bee77

Please sign in to comment.