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

Re: suggestion of adding top,right,bottom,right to box-shadow

From: Mark Kenny <beingmrkenny@gmail.com>
Date: Wed, 14 Sep 2011 17:28:29 +0100
Message-ID: <CAEep_bcnbKOSBAgo3N3qf+uEYSfNj0SUAEwuCwjKBj_GNHaGDg@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: Alan Gresley <alan@css-class.com>, shi chuan <shichuanr@gmail.com>, Simon Fraser <smfr@me.com>, "www-style@w3.org" <www-style@w3.org>
Sorry, I was thinking that instead of specifying a shadow just for top and
bottom, it would be more in keeping the concept of a shadow to change its
shape. So, to have a "top and bottom shadow", give it more height and less
width that the object whose shadow it is.

Thinking about the original post, perhaps it would be better to be able to
specify blur radius and/or spread on different sides?

Something like:

box-shadow: 0 0 black; /* No offset, no blur, no spread: shadow is
effectively invisible */
box-shadow-blur-radius: 20px 0 0 20px; /* blur two edges, keep other two
crisp */
box-shadow-blur-spread: 20px 0 0 20px; /* stretch out top and left, keep
bottom and right at 0 */

That would give crisp lines on right and bottom, and blurry edges on left
and top.


Mark Kenny

On 14 September 2011 16:51, Brad Kemper <brad.kemper@gmail.com> wrote:

> On Sep 14, 2011, at 8:40 AM, Mark Kenny wrote:
> I sent this from my other email, so apologies since it will come through
> twice.
> I think a better native solution would be to specify the shape of the
> shadow, for example:
> box-shadow-transform: height% width%;
> Where height% and width% were percentages of the box dimensions. Obviously
> other values could be used: absolute lengths, expressions such as original -
> x pixels etc.
> That might be useful at times, but I don't see how it is a better solution
> for Shi's situation. If the shadow was just shorter, then it would still
> have rounded corners from the blur. Whereas cropping the shadow or sending
> it to a lower layer than the element would give the sharp edge division that
> this layout needs.
Received on Wednesday, 14 September 2011 16:29:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:50:06 UTC