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

Re: [css3-images] closest side radial gradients

From: Brad Kemper <brad.kemper@gmail.com>
Date: Wed, 2 Nov 2011 15:20:20 -0700
Message-Id: <623C2892-64EA-4B28-BF8B-0C410458F9B8@gmail.com>
Cc: www-style list <www-style@w3.org>
To: Brian Manthos <brianman@microsoft.com>
On Nov 2, 2011, at 1:57 PM, Brian Manthos <brianman@microsoft.com> wrote:

>>>> What I think we should consider is that closest-side should not make the gradient smaller.
>>>> The way this would work is that 'closest-side' would not consider the side(s) that you've
>>>> offset the gradient towards when determining which is closer, and the gradient would
>>>> get clipped instead.
>>> 
>>> I wish the image would load for me. :(
>>> 
>>> Nonetheless, as you've described it, the proposed behavior wouldn't be "closest-side" anymore.  It would be "closest-side-except-this-one-here"
>> Right.
> 
> So we agree on this part.
> 
> What phrase/keyword would you replace "closest-side" with, so that it has an absolutely clear yet succinct meaning.

I don't know that it has to be replaced. It is the closest side that you would actually want to expand the gradient towards, the closest side that still allows side-to-side coverage in at least one dimension. You don't have to put all those details into the keyword, just as we don't have to say 'closest-side-to-the-center-not-closest-side-to-the-user'. But I'm open to other suggestions for the keyword.

> not consider the side(s) that you've
>>>> offset the gradient towards when determining which is closer
> 
> Example:
> div {
>    width: 100px;
>    height: 200px;
>    radial-gradient(10px 10px, brad-modified-closest-side, red, blue);
> }
> 
> Do you exclude both the top and the left from "consideration" since you've moved toward both?

Correct.

> I'm still trying to understand how this proposal is at all an improvement, but I'm trying to give it a fair hearing.

I find it less surprising. One of the reasons I was pushing for simplification before is because of the non-obvious and unintuitive (to me) side effects that  the different parameters had on each other, such as this one. I didn't really expect 'contain' to shrink the gradient line as a result of changing the offsets. Having the gradient center align with a corner or side would seem to be the most common use for the positioning of the radial gradient, yet that is a case that make 'closest-side' (aka 'contain') unusable. My proposal would change that, and make it more usable. I believe it would even be more generally useful for other positions too, instead of always shrinking. It makes the syntax more versatile at the same time, because you can still create the shrinking behavior in other ways.
Received on Wednesday, 2 November 2011 22:21:00 GMT

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