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

Re: Gradient syntax proposal

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 17 Aug 2009 12:03:43 -0500
Message-ID: <dd0fbad0908171003u4ad37499w98a5ee2b4856ee31@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: David Perrell <davidp@hpaa.com>, Andrew Fedoniouk <news@terrainformatica.com>, www-style list <www-style@w3.org>
On Mon, Aug 17, 2009 at 10:28 AM, Brad Kemper<brad.kemper@gmail.com> wrote:
> On Aug 16, 2009, at 11:15 PM, David Perrell wrote:
>> | If you allow lengths and percentages in the same list of color stops,
>> | then stops could trade places based on the size of the box they are in.
>>
>> Not if stops are forced to be in ascending order, so if a color-stop
>> specifies a position before a previous color-stop, its position is changed
>> to that of the previous stop. There are situations where that might be
>> considered graceful degradation.
>
> I'm not sure why that is better. Either way, the UA will have to figure out
> where the location will be for each stop before it lays out the gradation.
> I'd prefer to either insist on all units in a gradation being the same (so
> they can be in order without ambiguity), or just let them be out of order.
> If allowed in any order, if you have the following in a 100px height box:
>
> linear-gradient(top / white, yellow 80px, green, blue 60%, black)
>
> the used value would be:
>
> linear-gradient(top / white 0, blue 60px, green 70px, yellow 80px, black
> 100%)
>
> The green would be half way between 80px and 60px (60% of a 100px box).

Nah, I really don't think it's acceptable that you have no way of
telling where that blue stop is going to be in relation to the others.
 I'd *much* rather have it become:

linear-gradient(top / white 0, yellow 80px, green 80px, blue 80px, black 100%)

This completely hides the green and makes a sharp transition from
yellow to blue, but if the box gets taller it then cleanly expands the
yellow/blue boundary to have a green transition.  Your interpretation
would have a white->blue and yellow->black transition when the box was
short, but a white->yellow and blue->black transition when the box was
tall.  That's almost certainly not what was intended.

~TJ
Received on Monday, 17 August 2009 17:05:57 GMT

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