Re: Gradient syntax proposal

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 UTC