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

Re: Gradient syntax proposal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 14 Aug 2009 09:34:40 -0500
Message-ID: <dd0fbad0908140734s35bdc82ci6861605a8f4ea77a@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: Andrew Fedoniouk <news@terrainformatica.com>, www-style list <www-style@w3.org>
So, hey, let's talk about my proposal.  ^_^

The color-stop syntax should be uncontroversial.  It's roughly what
everyone else is using.  It's a string of comma-separated colors,
optionally paired with %.  Colors without % are inferred to be equally

The important bit is just the productions at the beginning that define
the gradient-line.  I spent some time thinking about the gradients
that I have used on websites before, and ones that I'd like to use in
the future, to come up with the set of ways of specify a linear

Firstly (for me), you've got the simply horizontal and vertical
gradients.  These are most simply specified (to me) by simply saying
which sides you want to go between, so "left right"/"top bottom"/etc.

Secondly, corner-to-corner gradients.  These are again specified very
simply by just indicating which corner you want to start them from, so
"top left" would go from the top-left corner to the bottom-right

That exhausts what can be specified by simple keywords.  Then we have
specific angles.  Just specify an angle and you're done.  I added the
'inner' and 'outer' keywords because I can think of designs that would
call for both.

Finally, for nearly all the cases not covered by the above, the fuller
bg-position syntax is available to specify the endpoints of the

Am I missing anything?  Am I making anything too complex?  Are there
ways to improve this/make it simpler/make it prettier?

Received on Friday, 14 August 2009 14:35:36 UTC

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