RE: Gradient syntax proposal

Tab Atkins Jr. wrote:
| Am I missing anything?  Am I making anything too complex?  Are there
| ways to improve this/make it simpler/make it prettier?

100% agree with color-stops. As for start/end/angle, it seems it would be plenty simple enough if both startpoint and endpoint/angle were required parameters.
 
Given an element 100px wide where 1em = 20px and 0deg is left->right, these would be equivalent:

linear-gradient(0 0, 100% 0, red, blue);
linear-gradient(0 0, 100% 0, red 0%, blue 100%);
linear-gradient(left, right, red, blue);
linear-gradient(0 0, 0deg, red, blue 5em);
linear-gradient(0 0, 0deg, red 0px, blue 100px);

First parameter is the start point. The second parameter can be either an end point or an angle. In the case of an angle, 100% = distance from start point to the intersection with the inside border. In the case of left/right/top/bottom, if only one is given then the other is assumed to be 0.

David Perrell

Received on Friday, 14 August 2009 16:42:35 UTC