[css4-images] One color stop should now be allowed

Since we can now have two positions per color stop [1], which is equivalent to two color stops with the older syntax, gradients should permit one color stop only. Grammar-wise, it's only a matter of converting a few +s to *s.

In case the only color stop doesn't include two positions, it could be defined as equivalent to having 0% 100%. Yes, this is essentially identical to using image(color), but:
1. There is no serious reason to disallow degenerate applications of any CSS feature and few other CSS features do.
2. It ensures consistency and matches author expectations.
3. Good educational value: People who use editors that live update will be able to see what they're doing before they even type the second color. Instant feedback is an age-old UI principle and syntax is the UI of the language.
4. It's trivial to implement.

[1]: http://www.w3.org/TR/css4-images/#color-stop-syntax

Lea Verou
W3C developer relations
http://w3.org/people/all#leahttp://lea.verou.me ✿ @leaverou

Received on Monday, 5 November 2012 19:05:14 UTC