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

Re: Gradient syntax proposal

From: Brad Kemper <brad.kemper@gmail.com>
Date: Fri, 14 Aug 2009 10:53:48 -0700
Cc: Martin McNickle <mmcnicklebugs@googlemail.com>, Andrew Fedoniouk <news@terrainformatica.com>, www-style list <www-style@w3.org>
Message-Id: <CBE3B523-61F3-4A8D-BBD8-D0058D0ADAD4@gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Aug 14, 2009, at 10:31 AM, Tab Atkins Jr. wrote:

> On Fri, Aug 14, 2009 at 12:10 PM, Martin
> McNickle<mmcnicklebugs@googlemail.com> wrote:
>> On Fri, 2009-08-14 at 09:34 -0500, Tab Atkins Jr. wrote:
>>> Am I missing anything?  Am I making anything too complex?  Are there
>>> ways to improve this/make it simpler/make it prettier?
>>
>> Given that a large number of these gradients will be simple
>> vertical/horizontal ones, you could make the following  
>> simplification:
>>
>> <gradient-line>:
>> [
>>  <angle> [inner | outer]?
>> |
>>  [ left | right | top | bottom ] [ left | right | top | bottom ]?
>> |
>>  <bg-position>, <bg-position>
>> ]
>>
>> where the second keyword is now optional.
>>
>> When the second keyword is omitted, you assume the opposite side.
>>
>> So:
>>
>> background: linear-gradient(top, yellow, blue);
>> background: linear-gradient(top bottom, yellow, blue);
>>
>> are equivalent as are:
>>
>> background: linear-gradient(right, yellow, blue);
>> background: linear-gradient(right left, yellow, blue);
>>
>> The syntax for producing a simple vertical/horizontal gradient is  
>> now very succinct.
>
> Ooh, good idea.  That also makes it congruent with the corner syntax,
> where you just specify one corner and the opposite is assumed.  I've
> changed the proposal to reflect that.
>
> ~TJ

If you have named sides (like you do) and named corners (something  
like border-radius has in its 4 names), then you don't need to mention  
the opposite side at all. You also then don't need to use the bg- 
position coordinate system with its possibility of 4 lengths separated  
by another comma.
Received on Friday, 14 August 2009 17:54:31 GMT

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