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

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

From: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 7 Jun 2011 12:27:59 -0700
Message-Id: <3B26E961-B7B8-407D-9441-664687145C0D@gmail.com>
Cc: "www-style@w3.org" <www-style@w3.org>
To: Brian Manthos <brianman@microsoft.com>


On Jun 7, 2011, at 11:34 AM, Brian Manthos <brianman@microsoft.com> wrote:

> Something was bugging me about the linear gradient keywords, and I think I narrowed it down.
> 
> The same issue applies to the Working Draft and the Editor's Draft.
> 
> For now, let's use the Working Draft:
> http://www.w3.org/TR/css3-images/
> 
> # The gradient-line may be specified in two different ways. The
> # first is by specifying the angle the gradient-line should assume;
> # this uses the standard algebraic notation for angles where 0deg
> # points to the right, 90deg points up, and positive angles go
> # counterclockwise. The starting-point and ending-point of the
> # gradient-line are determined by extending a line in both
> # direction from the center of the box at the angle specified.
> # [1]In the direction of the angle, the ending-point is the point on
> # the gradient-line where a line drawn perpendicular to the
> # gradient-line would intersect the corner of the box in that
> # direction. The starting-point is determined identically, except
> # in the opposite direction of the angle.[/1]
> #
> # The [2]second way is to simply provide a side or corner of the box
> # that the gradient should start[/2] at; the gradient will then
> # automatically angle itself to [3]extend from the specified side or
> # corner to the opposite[/3] side or corner in a straight line. To be
> # precise, the gradient is converted to the angle form described
> # in the previous paragraph at used-value time. If a 'left',
> # 'bottom', 'right', or 'top' is given, the used value of the gradient
> # is 0deg, 90deg, 180deg, or 270 deg, respectively. If a corner is
> # given, the used value of the gradient is the angle necessary to
> # place the starting-point of the gradient in that corner of the box. 
> 
> 
> Paraphrasing [1]:
> When specified via angle, the angle can be understood as both the direction ("toward the <angle>") and the ending point ("ends at <angle>").
> 
> Paraphrasing [2] and [3]:
> When specified via keyword, the keyword can be understood as both opposite direction ("away from the <keyword(s)>") and the starting point ("starts at  <keyword>").
> 
> 
> Is it intentional that these two ways of specifying gradient-line are opposite?

I don't think they are. In [1], the angle determines the starting AND ending points. In [2] and [3], the ending point (and thus the direction) is determined by the starting point. I see no inconsistency. 
Received on Tuesday, 7 June 2011 19:28:36 GMT

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