W3C home > Mailing lists > Public > www-style@w3.org > June 2011

Re: [css3-images] linear-gradient keywords and angles are opposite

From: fantasai <fantasai.lists@inkedblade.net>
Date: Fri, 10 Jun 2011 11:31:16 +0900
Message-ID: <4DF181F4.10103@inkedblade.net>
To: www-style@w3.org
On 06/10/2011 10:26 AM, Eric A. Meyer wrote:
> At 10:46 -0700 6/9/11, Tab Atkins Jr. wrote:
>
>> On Thu, Jun 9, 2011 at 10:33 AM, Brian Manthos <brianman@microsoft.com> wrote:
>
>>> And thus, finally, the root cause of the problem is obvious: The spec as currently authored decided to choose "left/right
>>> the start location" instead of "left/right the direction".
>>
>> Yup, that's for historical reasons at this point - the first draft of
>> linear gradients I wrote let you specify an explicit start point and
>> end point for the gradient-line. I stuck with that model as the
>> syntax mutated and simplified.
>
> I still prefer the idea of defining start and end points and having the gradient lines be perpendicular to the line described
> by those points. It's fairly unambiguous, it lets authors use any angle at any point within (or even outside) the background
> area, and it avoids the whole keyword confusion. And it seems really easy and clear to animate as well.
> If we wanted to ensure the ability to use angles, then the syntax could be written so that an angle can be used for the second
> value. That would make the following equivalent:
>
> linear-gradient: 50% 50%, 100% 0, black, white;
> linear-gradient: 50% 50%, 45deg, black, white;

I hate this profusion of commas. CSS is not a programming language.
We do not need to use commas that treat all types of arguments
syntactically the same. This is, in fact, one of the annoying things
about functional notation in general -- when reading a function call
in a positional notation you need to know the order of parameters of
the function to know which argument is which.

What is wrong with specifying "<point> to <point>"? This is CSS.
We can do that. It is eminently obvious with such a syntax what
the two arguments mean.

I would even go so far as to suggest
   linear-gradient(<point> to <point> as <color-stops-list>)
or
   linear-gradient(<direction> as <color-stops-list>)
because the fact that each color stop is currently equal in argument
level to the directional argument bugs me. (Logically, from my POV,
linear-gradient takes two arguments: a path and a color-stop-list.)

~fantasai
Received on Friday, 10 June 2011 02:31:52 GMT

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