W3C home > Mailing lists > Public > www-style@w3.org > March 2011

Re: [CSS3] linear-gradient() proposal

From: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 29 Mar 2011 07:47:21 -0700
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, <www-style@w3.org>
Message-Id: <096CB9EC-9EA0-4153-ADB4-18D548E668B2@gmail.com>
To: "Andrew Fedoniouk" <news@terrainformatica.com>

On Mar 28, 2011, at 8:52 PM, Andrew Fedoniouk wrote:

> Brad, start and end points of linear gradient in your version are non-deterministic in the sense that it is not possible
> to define where gradient starts and where it ends precisely.  So these cases:
> http://terrainformatica.com/w3/linear-align-2.png are simply impossible to define with your schema (sorry for “cauchemar” colors there).

Right. As I said before, it is designed to be simple. That is more important than being able to create any possible gradient that can be created by SVG. There is nowhere near as common a need for the more complex gradients that a more complex syntax allows.

>  Radial gradient allows to define precisely where the gradient starts and where it ends with various handy presets:
> http://terrainformatica.com/w3/radial-align-positioning.png

In my opinion, radial gradients are a bit over powered currently, and could be simpler. I expect radial gradients to be much less common than linear gradients, and thus could get by without serving even edgier edge cases. But in any case, Tab designed it in the way that he thought was the right mixture of simplicity and power for the most needed radial gradients.

> I’ve implemented your schema already and discovered that it is quite limiting.
> It is useful in quite narrow range of angles.
> E.g. this linear-gradient(top left, yellow, blue);
> looks almost the same in your case for angles 30..60. So it is not clear why do you
> need angles there at all.

Keyword gradients such as "top left" go from corner to corner. Angle gradients stay at a consistent angle no matter what the box size. Specifying the direction via angle is also the most common and familiar way to specify an angle textually in existing software (as I said before). And vanishingly few gradients in the wild need to be so precise as to require two length measurements instead of one for the first or last color stops.
Received on Tuesday, 29 March 2011 14:47:57 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:38 GMT