Re: [css4-images] Color stop syntax

On Fri, Sep 21, 2012 at 6:07 AM, Lea Verou <lea@w3.org> wrote:
> A few days ago, I gave a talk at SmashingConf, in which I included some
> small live demos with gradients. During one of them, I wrote something like:
>
> background: linear-gradient(1px black, 1px transparent);
>
> Neither I nor anyone in the 300 authors in the audience could see what was
> wrong with it, until I gave up and decided to move on to the next demo.
> Of course, I later realized what the problem was. The color stop position
> was before the color. But why is that disallowed? There doesn’t seem to be
> any reason to require it and traditionally in CSS order doesn’t matter when
> disambiguation is possible regardless of it.

Probably because I accidentally made it order-dependent early on, and
never thought to change it.  I don't see any particular reason to keep
it order-dependent - as you say, CSS traditionally lets us use any
order as long as it's unambiguous.

I'll go ahead and change it in the Images 4 ED.


> Also: Great idea to allow 2 positions. Hadn’t noticed it before. This was
> sorely needed for so many use cases!

I wouldn't call it "sorely needed" (it doesn't add any new abilities),
but it is indeed very convenient for doing stripes, which is a common
use-case.

~TJ

Received on Friday, 21 September 2012 20:45:20 UTC