Re: [css3-background] CSS Drop Shadows

On Dec 19, 2007, at 9:54 AM, Brad Kemper wrote:

> Well, I guess that is the big question. Personally, I think most of  
> the time I wouldn't mind having the show continue fully under the  
> box, but it might be useful at times to turn that off, perhaps with  
> an extra parameter to box-shadow to say if that it is knockout  
> (defaulting to "not").

We can't implement the other way.   Shadows in CoreGraphics are drawn  
as a side effect of another drawing operation.  You "turn on" shadows  
in the graphics context, do some drawing, and a shadow is cast by  
whatever you draw automatically.  This means that in order to  
implement box-shadow, we actually have to do a fill rect operation.   
The only way to show only the shadow and not the fill is to set a clip  
that prevents the area occupied by the fill from being drawn into.

For a fully transparent box, there is no shadow to be cast, since  
there is no fill, and the shadow is inside the area occupied by any  
fill that we would do in order to get the shadow to draw in the first  

> It is interesting to note that when combining text-shadow with  
> opacity that the shadow does not show through the letters. It does  
> seem as though there should be some consistency between the text- 
> shadow and box-shadow.

It's not supposed to.  opacity blends everything inside the layer  
after the fact as a single unit. so I think this is not a very good  
example to bring up.

If you did RGBA text with text-shadow, then you would see the shadow  
behind the letters.


Received on Wednesday, 19 December 2007 18:07:29 UTC