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

shadow through transparent background (was Re: Shadow knockout)

From: Alan Gresley <alan@css-class.com>
Date: Thu, 27 Jan 2011 17:06:52 +1100
Message-ID: <4D410B7C.1090903@css-class.com>
To: "Eric A. Meyer" <eric@meyerweb.com>
CC: www-style@w3.org
On 27/01/2011 3:05 PM, Eric A. Meyer wrote:

> I don't doubt it. I do have to wonder why an outset shadow is clipped by
> the border box, though. Because it is a bit weird to shadow a box, then
> decide to make the background transparent and not see the rest of the
> shadow. Is that an ease-of-implementation thing?

No, some members of the CSS WG in there wisdom decided that a box-shadow 
seen through a transparent background was wrong. I argued against it 
back in 2008 [1]. I suggested it again a few weeks ago [2]. It would 
work like this (the default would be mask).

  box-shadow: 10px 10px 10px 0 <color> cast;

> Or is it that because
> backgrounds are transparent by default, it's thought the shadow
> shouldn't be visible behind the content because that could create
> legibility problems?

Not if it's done carefully. Also a box-shadow does not have to be dark. 
If you offset the box-shadow enough, you can see how the full box-shadow 
is rendered. This means that a full box-shadow is painted first and then 
implementations have to apply a mask on the shadow where it intersects 
the border-box of the background.

1. <http://lists.w3.org/Archives/Public/www-style/2008May/0165.html>
2. <http://lists.w3.org/Archives/Public/www-style/2011Jan/0042.html>

Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
Received on Thursday, 27 January 2011 06:07:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:55 UTC