W3C home > Mailing lists > Public > www-style@w3.org > November 2012

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

From: Lea Verou <lea@w3.org>
Date: Mon, 5 Nov 2012 21:05:00 +0200
Message-Id: <B71C13E3-CA7D-411E-B4E2-B0B21A8DE421@w3.org>
To: www-style list <www-style@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:23 UTC