Re: radial-gradient() proposal

On Sun, Sep 6, 2009 at 11:12 AM, David Perrell<davidp@hpaa.com> wrote:
> Tab Atkins Jr. wrote:
> | I'm finally happy with my radial-gradient() syntax.  You can view it
> | at http://www.xanthir.com/:4bhipd (scroll down past the
> | linear-gradient() examples).
>
> Thanks for the warm regards and kind acknowledgement. Most of your update looks good to me (you even got 'contain' contained).

No problem, dude.  Your arguments were the big thing that motivated
this, just as Brad's arguments were the major motivation behind my
linear-gradient syntax.

> But I'm not understanding the description of the <angle> variable (my initial thought was: "tilted ellipse?"). Why would I want to specify gradient-line direction other than to sides or corners?

Not sure.  But I think you need to be able to specify the direction
you're measuring in; you at least need to be able to specify between
the major and minor axis of the ellipse.  Using the full <angle> gives
us a direct analogue to linear gradient so there's less relearning,
even if a lot of the power gets wasted.

You do bring up a good point that I want to address, though, and that
it's not possible with an explicit angle to reliably measure lengths
to a corner.  You *can* still do this properly with percentages (a
farthest-corner gradient, frex, still has 100% exactly on the corner),
it's just lengths that are difficult.  However, these are all at an
angle.  I don't *believe* that it's important to get exact length
measurements along an unpredictably-angled diagonal - when you want
that sort of precision you're generally trying to align with something
else on the page, and thus want to measure horizontally or vertically.
 If you can prove me wrong, go ahead.

> And what does it mean that a gradient-line extends "in from the starting-point" with default angle "0deg...to the left?"

I've revised that sentence.  Does it make more sense now?  If I can't
explain it in the language of the proposal, then I need to rewrite it
until I can.

> If the default gradient-line is horizontal and the horizontal axis is the minor axis of a narrow ellipse, then <length> color-stops won't always translate as intended from the shorter to the longer axis. You'd have to specify a 90 or 270deg angle to put the gradient-line on the major axis where <length> measurements are most accurate. That doesn't seem right.

Yeah, if you want your <length>s to run along the vertical axis, you
need to say so.  I don't understand why measuring the lengths along
the minor axis is somehow worse than measuring it along the major,
though - it just depends on what you're trying to align to.  And what
do you mean by 'accurate'?  The fact that translating from the minor
axis to the major axis may be somewhat pixel-ambiguous?  This is true,
but I don't think it's that important.  Again, if you're measuring
along the minor axis, that's the line you want to align with things.
The other axis isn't as important, imo.

> What would be lost if you remove the <angle> option and have the gradient-line run from the start-point to the specified <size> point? That seems simpler and more intuitive, and less apt to produce undesirable effects. I somehow got the impression that's what you were thinking of before you updated your draft.

Elliptical gradients don't derive a single reasonable point from
<size> in the case of closest-side or farthest-side, they have two.
And while the -corner sizes do give a single favored point, I can
easily see myself still wanting to measure along the horizontal or
vertical axis.  I just think that requiring precise <length>s along a
diagonal is a minority case (and can be approximated well enough when
necessary by estimating an <angle>).

In my previous draft I *sort of* meant that.  For elliptical gradients
you could use <axis> to specify what direction to measure <length>s
along: horizontal, vertical, major, or minor.  However, that made a
bit of a hash of things since <axis> meant something *different* for
circular gradients.  The current <size> is a combination of the old
<size> and the circular <axis>, while the elliptical <axis> became
<angle>.

~TJ

Received on Sunday, 6 September 2009 16:58:29 UTC