- From: yarusome via GitHub <sysbot+gh@w3.org>
- Date: Wed, 18 Jan 2023 01:59:53 +0000
- To: public-css-archive@w3.org
yarusome has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-images] Aligning the grammar of linear color stops with current implementations ==
The [spec](https://w3c.github.io/csswg-drafts/css-images-3/#color-stop-syntax) defines:
````
<linear-color-stop> = <color> && <length-percentage>?
````
But [MDN](https://developer.mozilla.org/docs/Web/CSS/gradient/linear-gradient) shows that all current implementations support an extra syntax, formally:
````
<color> <length-percentage1> <length-percentage2>
````
Moreover, experimenting with Gecko shows the following results:
````
linear-gradient(red, blue, green) // valid syntax
linear-gradient(red, blue 30%, green) // valid syntax
linear-gradient(red, 30% blue, green) // invalid syntax
linear-gradient(red, blue 30% 50%, green) // valid syntax
linear-gradient(red, 30% blue 50%, green) // invalid syntax
linear-gradient(red, 30% 50% blue, green) // invalid syntax
linear-gradient(red, blue 30% 50% 70%, green) // invalid syntax
````
Therefore it seems that the actual syntax of linear color stops is:
````
<linear-color-stop> = <color> <length-percentage>{0,2}
````
Should the spec be edited to reflect this?
Related CSS issue: #6425
Related MDN issue: https://github.com/mdn/content/issues/23718
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8323 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 18 January 2023 01:59:55 UTC