Skip to content

Commit

Permalink
Merge pull request #1889 from sass/draft-1.4
Browse files Browse the repository at this point in the history
Update specs for sass/sass#3497
  • Loading branch information
nex3 authored Mar 23, 2023
2 parents 8c3ef6f + 8d48c8a commit 70c8dc2
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 59 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,24 @@ jobs:
version: ${{ env.PROTOC_VERSION }}
repo-token: '${{ github.token }}'

# Clone linked versions of Dart Sass Embedded and the Embedded Protocol so
# that they match the current feature branch.
- name: Dart Sass Embedded | Checkout
uses: sass/clone-linked-repo@v1
with: {repo: sass/dart-sass-embedded, path: dart-sass-embedded}
- name: Embedded Protocol | Checkout
uses: sass/clone-linked-repo@v1
with: {repo: sass/embedded-protocol, path: embedded-protocol}

- name: Node.js Embedded Host | Checkout
uses: sass/clone-linked-repo@v1
with: {repo: sass/embedded-host-node, path: embedded-host-node}
- name: Node.js Embedded Host | Install
run: |
npm install
npm run init
npm run init -- \
--compiler-path=../dart-sass-embedded \
--protocol-path=../embedded-protocol
npm run compile
working-directory: embedded-host-node

Expand Down
2 changes: 1 addition & 1 deletion spec/core_functions/color/hsl/three_args/units.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ a {b: hsl(60rad, 100%, 50%)}

<===> hue/angle/output.css
a {
b: hsl(3437.7467707849deg, 100%, 50%);
b: hsl(197.7467707849deg, 100%, 50%);
}

<===> hue/angle/output-libsass.css
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ a {
step-8: hsl(324deg, 100%, 50%);
step-9: hsl(336deg, 100%, 50%);
step-10: hsl(348deg, 100%, 50%);
step-11: hsl(360deg, 100%, 50%);
step-11: hsl(0deg, 100%, 50%);
}

<===> output-libsass.css
Expand Down
36 changes: 18 additions & 18 deletions spec/core_functions/color/hsl/three_args/w3c/hue.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -17,44 +17,44 @@
<===> output.css
red {
hue-0: hsl(0deg, 100%, 50%);
hue--360: hsl(-360deg, 100%, 50%);
hue-360: hsl(360deg, 100%, 50%);
hue-6120: hsl(6120deg, 100%, 50%);
hue--360: hsl(0deg, 100%, 50%);
hue-360: hsl(0deg, 100%, 50%);
hue-6120: hsl(0deg, 100%, 50%);
}

yellow {
hue-60: hsl(60deg, 100%, 50%);
hue--300: hsl(-300deg, 100%, 50%);
hue-420: hsl(420deg, 100%, 50%);
hue--9660: hsl(-9660deg, 100%, 50%);
hue--300: hsl(60deg, 100%, 50%);
hue-420: hsl(60deg, 100%, 50%);
hue--9660: hsl(60deg, 100%, 50%);
}

green {
hue-120: hsl(120deg, 100%, 50%);
hue--240: hsl(-240deg, 100%, 50%);
hue-480: hsl(480deg, 100%, 50%);
hue-99840: hsl(99840deg, 100%, 50%);
hue--240: hsl(120deg, 100%, 50%);
hue-480: hsl(120deg, 100%, 50%);
hue-99840: hsl(120deg, 100%, 50%);
}

cyan {
hue-180: hsl(180deg, 100%, 50%);
hue--180: hsl(-180deg, 100%, 50%);
hue-540: hsl(540deg, 100%, 50%);
hue--900: hsl(-900deg, 100%, 50%);
hue--180: hsl(180deg, 100%, 50%);
hue-540: hsl(180deg, 100%, 50%);
hue--900: hsl(180deg, 100%, 50%);
}

blue {
hue-240: hsl(240deg, 100%, 50%);
hue--120: hsl(-120deg, 100%, 50%);
hue-600: hsl(600deg, 100%, 50%);
hue--104880: hsl(-104880deg, 100%, 50%);
hue--120: hsl(240deg, 100%, 50%);
hue-600: hsl(240deg, 100%, 50%);
hue--104880: hsl(240deg, 100%, 50%);
}

purple {
hue-300: hsl(300deg, 100%, 50%);
hue--60: hsl(-60deg, 100%, 50%);
hue-660: hsl(660deg, 100%, 50%);
hue-2820: hsl(2820deg, 100%, 50%);
hue--60: hsl(300deg, 100%, 50%);
hue-660: hsl(300deg, 100%, 50%);
hue-2820: hsl(300deg, 100%, 50%);
}

<===> output-libsass.css
Expand Down
41 changes: 13 additions & 28 deletions spec/core_functions/color/mix/error.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ Error: $method: Expected "hsl longer hue" to be an unquoted string.

<===>
================================================================================
<===> invalid_method/options.yml
<===> invalid_method/wrong_hue_keyword/options.yml
:ignore_for:
- libsass

<===> invalid_method/input.scss
<===> invalid_method/wrong_hue_keyword/input.scss
a {b: mix(red, blue, $method: hsl longer shade)}

<===> invalid_method/error
<===> invalid_method/wrong_hue_keyword/error
Error: $method: Expected unquoted string "hue" at the end of (hsl longer shade), was shade.
,
1 | a {b: mix(red, blue, $method: hsl longer shade)}
Expand All @@ -176,37 +176,22 @@ Error: $method: Expected unquoted string "hue" at the end of (hsl longer shade),

<===>
================================================================================
<===> invalid_space/options.yml
<===> invalid_method/unsupported/options.yml
:ignore_for:
- libsass

<===> invalid_space/input.scss
a {b: mix(red, blue, $method: display-p3 shorter hue)}
<===> invalid_method/unsupported/input.scss
// "specified" was a method in an earlier draft of CSS Colors 4, but it was
// dropped because it required implementations to lazily normalize hues.
a {b: mix(red, blue, $method: hsl specified hue)}

<===> invalid_space/error
Error: $method: Color space display-p3 can't be used for interpolation.
<===> invalid_method/unsupported/error
Error: $method: Unknown hue interpolation method specified.
,
1 | a {b: mix(red, blue, $method: display-p3 shorter hue)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 | a {b: mix(red, blue, $method: hsl specified hue)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> invalid_space_rgb/options.yml
:ignore_for:
- libsass

<===> invalid_space_rgb/input.scss
a {b: mix(red, blue, $method: rgb)}

<===> invalid_space_rgb/error
Error: $method: Color space rgb can't be used for interpolation.
,
1 | a {b: mix(red, blue, $method: rgb)}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:7 root stylesheet
input.scss 3:7 root stylesheet

<===>
================================================================================
Expand Down
12 changes: 12 additions & 0 deletions spec/core_functions/color/mix/explicit_method.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ a {
b: lab(50.3820989016% 23.739480318 159.7498257827);
}

<===>
================================================================================
<===> previously_invalid/input.scss
// An earlier draft of CSS Colors 4 didn't allow some spaces because they were
// redundant with others, but they should be allowed now.
a {b: mix(lab(54.3 80.8 69.9), lch(46.3 68 134), $method: display-p3)}

<===> previously_invalid/output.css
a {
b: lab(43.9078099681% 26.0060363023 48.9943374049);
}

<===>
================================================================================
<===> weighted/input.scss
Expand Down
10 changes: 0 additions & 10 deletions spec/core_functions/color/mix/hue_interpolation.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ a {
b: rgb(0, 0, 191.5);
}

<===>
================================================================================
<===> specified/input.scss
a {b: mix(red, green, $method: lch specified hue)}

<===> specified/output.css
a {
b: rgb(145.2072868242, 115.9916273156, -48.1699603699);
}

<===>
================================================================================
<===> increasing/weighted/input.scss
Expand Down

0 comments on commit 70c8dc2

Please sign in to comment.