Add support for the relative color syntax from CSS Color 5 (#3676)

When using the relative color syntax, the color function is emitted as a
CSS function (similar to cases using a CSS variable in arguments).
This commit is contained in:
Christophe Coevoet 2023-09-29 22:29:19 +02:00 committed by GitHub
parent 46a75f4353
commit 83a9b01364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,8 @@
## Draft 1.11
* Add support for the relative color syntax in the algorithm parsing color
arguments, for CSS compatibility.
## Draft 1.10
* Properly scale `%` return values for `color.channel()`.

View File

@ -1,4 +1,4 @@
# CSS Color Level 4, New Color Spaces: Draft 1.10
# CSS Color Level 4, New Color Spaces: Draft 1.11
*([Issue](https://github.com/sass/sass/issues/2831))*
@ -1023,6 +1023,10 @@ The procedure is:
* If `components` is not an unbracketed space-separated list, throw an error.
* If the first element of `components` is an unquoted string which is
case-insensitively equal to `from`, return an unquoted string with the
value of `input`.
* If `space` is null:
* Let `input-space` be the first element in `components`.

View File

@ -272,6 +272,10 @@ plain CSS function named `"rgb"` that function is named `"rgba"` instead.
* If `rgb` is not an unbracketed space-separated list, throw an error.
* If the first element of `rgb` is an unquoted string which is
case-insensitively equal to `from`, return a plain CSS function string
with the name `"rgb"` and the argument `$channels`.
* If `rgb` has more than three elements, throw an error.
* If `rgb` has fewer than three elements:
@ -289,6 +293,10 @@ plain CSS function named `"rgb"` that function is named `"rgba"` instead.
* If `$channels` is not an unbracketed space-separated list, throw an error.
* If the first element of `$channels` is an unquoted string which is
case-insensitively equal to `from`, return a plain CSS function string
with the name `"rgb"` and the argument `$channels`.
* If `$channels` has more than three elements, throw an error.
* If `$channels` has fewer than three elements:
@ -398,6 +406,10 @@ plain CSS function named `"hsl"` that function is named `"hsla"` instead.
* If `hsl` is not an unbracketed space-separated list, throw an error.
* If the first element of `hsl` is an unquoted string which is
case-insensitively equal to `from`, return a plain CSS function string
with the name `"hsl"` and the argument `$channels`.
* If `hsl` has more than three elements, throw an error.
* If `hsl` has fewer than three elements:
@ -415,6 +427,10 @@ plain CSS function named `"hsl"` that function is named `"hsla"` instead.
* If `$channels` is not an unbracketed space-separated list, throw an error.
* If the first element of `$channels` is an unquoted string which is
case-insensitively equal to `from`, return a plain CSS function string
with the name `"hsl"` and the argument `$channels`.
* If `$channels` has more than three elements, throw an error.
* If `$channels` has fewer than three elements: