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

I agree that it makes sense for editors and it's easy to implement. In
addition, it matches canvas and SVG behavior.
Canvas also specifies what happens if there are no color stops. Does that
case make sense for CSS?

Rik

On Mon, Nov 5, 2012 at 11:05 AM, Lea Verou <lea@w3.org> wrote:

> 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 Tuesday, 6 November 2012 01:48:20 UTC