Re: Gradient syntax proposal

On Aug 17, 2009, at 10:03 AM, "Tab Atkins Jr." <jackalmage@gmail.com>  
wrote:

> 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.

Nah, you don't know what was intended. Maybe I wanted the blue to line  
up nicely with the biottom of something else that was 60% of the box  
height, and the yellow to line up with the bottom of a picture first- 
child, and not have colors disappear altogether. It's not as clear-cut  
to guess the authors intentions as you make it out to be. If it is  
important to keep all the items in order, then don't make them  
disappear, which is equally as bad as taking the out of order.  
Instead, insist on all values being of the same unit. Otherwise, don't  
protect the author from himself, and just put the color stops where  
specified by the author. I don't have a problem with that. It's no  
worse than having multiple backgrounds, each with the background- 
position using different units. 
   

Received on Monday, 17 August 2009 17:33:47 UTC