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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 9 Jun 2011 10:46:26 -0700
Message-ID: <BANLkTi=mt27yPWRojq6Xxu2kgc4eHtQfn8F7fWEsPOSKzeDK2Q@mail.gmail.com>
To: Brian Manthos <brianman@microsoft.com>
Cc: Brad Kemper <brad.kemper@gmail.com>, fantasai <fantasai.lists@inkedblade.net>, Sylvain Galineau <sylvaing@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
On Thu, Jun 9, 2011 at 10:33 AM, Brian Manthos <brianman@microsoft.com> wrote:
> Yes, "from<keyword>" would be better than what we have today (in either draft) because then angles and keywords wouldn't be opposite from each other.
> The cleaner fix is to just recognize that it's far simpler to consistently use the first parameter to specify the direction of a vector along the gradient line.  Angles already match this model.  The keywords are currently backwards relative to this model.
> For keywords that model would map to:
>        "left" -> "leftwards"
>        "right" -> "rightwards"
>        "top" -> "topwards"
>        "bottom" -> "bottomwards"
> From there you might decide to switch to "upwards" and "downwards".  You then might decide that "upwards" and "downwards" don't need "wards" for clarity, since they already define direction.  If you then decide to remove it for all of them you get...
>        "left" = "direction of gradient is right to left"
>        "right" = "direction of gradient is left to right"
>        "up" = "direction of gradient is from bottom to top"
>        "down" = "direction of gradient is from top to bottom"

I'm still not completely happy with using 'left' and 'right' to refer
to direction, since they're also the names of sides.  Also, "left up"
doesn't read well to me ("up left" is *slightly* better, but not by
much).  However, I might just suck it up and go with that anyway.

I'll mark it as an issue for now.

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

Received on Thursday, 9 June 2011 17:47:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:46 UTC