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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 14 Sep 2011 08:17:08 -0700
Message-ID: <CAAWBYDATi5avL=Uba+0O6t-AqaFfXSSfF8z=f3b-Rene_YWXcQ@mail.gmail.com>
To: Alan Gresley <alan@css-class.com>
Cc: Brad Kemper <brad.kemper@gmail.com>, shi chuan <shichuanr@gmail.com>, Simon Fraser <smfr@me.com>, "www-style@w3.org" <www-style@w3.org>
On Wed, Sep 14, 2011 at 7:31 AM, Alan Gresley <alan@css-class.com> wrote:
> On 14/09/2011 11:18 PM, Brad Kemper wrote:
>>
>> The way you describe hiding parts of the shadow by specifying them
>> per-edge sounds awkward and unnatural. The UA would have to be able
>> to have separate offsets and blurs and spreads and colors for each
>> side, somehow joined at the corners. But based on your use case,
>> really all you need is a way to crop the shadow. Using
>> overflow:hidden is not that hacky a way to do it, and much more
>> natural than your idea.
>
>
> I'm not sure what Shi really wants.
>
> Maybe a mock up graphic may help us know what you are seeking. The way you
> described the corner joins in a way that is not how box-shadow currently
> works makes me wonder if this can not be done another way.
>
> The below demo may be more the rendering you are wanting.
>
> http://css-class.com/test/css/3/gradients/drop-shadows.htm

<http://blog.w3conversions.com/2011/09/css3-spread-value-and-box-shadow-on-one-side-only/>
is a blog post showing one method to achieve a shadow on only one side
of an element.  This only has minimal reasoning as to *why* you'd want
it, but one possible explanation is to achieve more of a "lifted"
look, where the shadow is smaller than the box.

I think this is already well-achieved by having a negative spread
radius (method 2 in the linked blog post).  Unless there's a good
reason why this won't work, I don't think it's necessary to add
anything to box-shadow.

~TJ
Received on Wednesday, 14 September 2011 15:18:15 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:04 UTC