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

RE: Gradient syntax proposal

From: David Perrell <davidp@hpaa.com>
Date: Wed, 19 Aug 2009 05:31:48 -0700
To: <www-style@w3.org>
Brad Kemper wrote:
| So could the second. Oh wait, it already is.

No argument.

| I'm just thinking there would be times when you wanted a gradient a
| fixed distance from the end, not just the beginning, not necessarily a
| mirror of the beginning measurement, so it would be nice to have a way
| to specify that without a lot of calc(), which is even harder to read.
| A second slash version doesn't seem so bad for that. Basically just a
| slash instead of a comma there.

Your proposal brings up an interesting comparison between having percentages
refer to the entire length of the gradient and having percentages refer to
the span between lengths. Given this transition (using your proposal):

background: linear-gradient(-70deg / blue 52px, yellow 20%, yellow 80% / red

In the case where 20% of the entire length of the gradient is less than
52px, is it better to have a hard transition from blue to yellow and yellow
to red, or to maintain blue-yellow/yellow-red gradients within the 52-pixel
solid-color edges? (Clearly, it is NOT good to have the yellow stop precede
the blue and the red stop precede the second yellow.)

There's yet another possibility when percentages refer to the entire
gradient length: should percentages trump <lengths>? (In the above case, the
start and end points would be moved outward. Any span specified with
<length> would be subject to compression.)

David Perrell
Received on Wednesday, 19 August 2009 12:33:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:28 UTC