Re: radial-gradient() proposal

On Wed, Nov 4, 2009 at 5:59 PM, Robert O'Callahan <robert@ocallahan.org> wrote:
> On Thu, Nov 5, 2009 at 2:41 PM, Simon Fraser <smfr@me.com> wrote:
>>
>> I haven't thought about radial-gradient yet, but I do see that the current
>> radial gradient proposal does not allow the author to place a radial
>> gradient in an arbitrary spot that does not necessarily touch the edges or
>> corners of the box. I think this use case is important, for example content
>> that wants to put a gradient on the <body> that creates a glow around some
>> element on the page.
>
> Wouldn't it be better design to put that glow somewhere associated with the
> element it's highlighting?
>
> You can use background-position to offset a radial gradient, if you need to.

One effect that Simon brought up in person that I think is valid is,
frex, a glow on a heading where the glow extends slightly out into the
top of the following content.  You can't do this as a background on
the heading without some nasty negative-margin hacks.

Alternately, an effect conceptually similar to a text-glow on some
selected text inline in a paragraph.  This definitely extends out past
the targetted element, underlapping the surrounding text to either
side and perhaps above and below somewhat, and I don't think you can
do this properly even *with* negative margins.

(This is probably better handled by some hypothetical advancement that
allows an element to project no-geometry paint from itself, however.
I'm not certain we want to encourage page authors to statically
position backgrounds and hope that they line up with some child
element.)

~TJ

Received on Thursday, 5 November 2009 02:08:50 UTC