W3C home > Mailing lists > Public > www-style@w3.org > August 2009

RE: Gradient syntax proposal

From: David Perrell <davidp@hpaa.com>
Date: Fri, 14 Aug 2009 09:41:16 -0700
To: "www-style list" <www-style@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:38 UTC