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

Re: Gradient syntax proposal

From: Brad Kemper <brad.kemper@gmail.com>
Date: Mon, 17 Aug 2009 16:51:01 -0700
Message-Id: <E50B131E-920D-47F3-A61C-B3D9922672CC@gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: David Perrell <davidp@hpaa.com>, fantasai <fantasai.lists@inkedblade.net>, "<www-style@w3.org>" <www-style@w3.org>

On Aug 17, 2009, at 1:55 PM, "Tab Atkins Jr." <jackalmage@gmail.com>  
wrote:

> On Mon, Aug 17, 2009 at 3:46 PM, Brad Kemper<brad.kemper@gmail.com>  
> wrote:
>> I kind of like this idea.
>>
>>
>> On Aug 17, 2009, at 11:27 AM, "David Perrell" <davidp@hpaa.com>  
>> wrote:
>>
>>> fantasai wrote:
>>> | I would prefer restricting stops to percentages. The swapping  
>>> effect
>>> | is confusing, and I don't see any reason you'd /need/ to use  
>>> lengths
>>> | when you can specify the length of the overall gradient already.
>>>
>>> Let's say I want to ensure that the first 2 stops of a vertical  
>>> gradient
>>> span a distance based on em dimensions. The 3rd should be 50% of the
>>> remaining length. So, with current proposals, I want:
>>>
>>> linear-gradient: top / aqua, darkblue 1em, darkblue 2em, aqua calc 
>>> (.5
>>> *(100%-2em)), blue;
>>>
>>> If the element height becomes less than 4 em, this is going to  
>>> become
>>> totally corrupted if ascending order isn't enforced. I would  
>>> rather have it
>>> degrade to a sharp delineation between darkblue and aqua.
>>>
>>> Perhaps a better option is to allow mixed location dimensions and  
>>> require
>>> locations in order, but say that <percentage> between <length>  
>>> locations
>>> applies to the span between the <length> locations. I believe that  
>>> would
>>> solve all the degradation issues and simplify the spec. If this  
>>> were the
>>> case, what's desired above would be spec'd like this:
>>>
>>> linear-gradient: top / aqua, darkblue 1em, darkblue 2em, 50%, blue;
>>>
>>> 50% applies to the halfway point between 2em and the end point.
>>>
>>> This not only makes sense, it will never degrade into something  
>>> totally
>>> unlike what's desired. And if you do use all the same types, it  
>>> will be
>>> exactly as if the same types were *required* with the current  
>>> proposals.
>>>
>>> David Perrell
>>>
>>
>
> Isn't this what you were just arguing against, Brad, with the idea
> that the order-swapping may be the author's intent?
>
> (Not that I'd be sad about a reversal on that case - with you on board
> I'd go ahead and alter my draft.)
>
> ~TJ


Thus is different. It is not so much about babysitting the author to  
make sure they don't accidentally do something they didn't intend, and  
then second-guessing their intentions. It is about specifying what one  
or more percentages mean when between two fixed lengths (or between a  
fixed length and either the beginning or end of the transition). It's  
no longer about capping percentages that fall outside the lengths;  
it's ensuring that any percentage from 0-100% can't fall outside the  
lengths. 
  
Received on Monday, 17 August 2009 23:51:54 GMT

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