Re: box-shadow and border-image and dashes

On Feb 18, 2009, at 1:25 AM, fantasai wrote:

>> By the way, if I have a dashed border (whether using border-style  
>> or image-border) with box-shadow, and had background-clip:padding- 
>> box, I'd hope to have something like the following:
>> http://www.bradclicks.com/cssplay/dottedAndShadowed.png
>> But the current implementations of box shadow I've seen don't give  
>> consistent or predictable results when using border-style:dashed  
>> with box-shadow and background-clip:padding-box. I would be able to  
>> easily create this effect with image-shadow if I created the  
>> shadows in the images themselves.
>
> You wouldn't get that by the current definition, you'd get a shadow
> around the border box. (Note that background-clip can be different
> for different layers of the background.)
>
> Box-shadow is a very simplistic tool. For more sophisticated  
> shadowing,
> you'd need a 'shadow' property that triggers a real shadow filter.

Ah, but if you created that dashed box with image-border, and an  
automatically generated shadow as we've been discussing, then it would  
almost look like this. Or could look like this if we said that the  
padding box also cast a shadow in that combination (that included  
background-clip:padding-box, box-shadow, image-border, and non- 
transparent/non-image background). Otherwise, the images of the border  
would have a shadow and the visible box wouldn't, which would look  
weird.

I am leaning towards Hyatt's idea of also having a separate "shadow"  
property, that used the alpha of everything in the box (including the  
contents and text, perhaps, if the background was not opaque (maybe a  
keyword to switch content-shadowing on or off?)) to determine where  
the shadow went. Then we could use that for this automatically  
generated image-border shadow too.

Then for regular box-shadow the author would create his own within the  
image (for more control, or to partially simulate the "shadow"  
property) and the UA would suppress the box-shadow. It seems to me  
that otherwise "shadow" is the property we are generating for image- 
border, not "box-shadow". It makes sense to me to suppress box-shadow  
given that most of the infinite shapes create-able by image-border  
would not be box shaped.

Is it too late to add "shadow" to backgrounds and borders? Or would it  
go in another module? I don't think there is a strong need for "border- 
shadow" by itself.

By the way, for regular (non-image) borders with border-styles that  
contain empty space (dashed, dotted, double, etc.), the current  
implementations are not consistent in how they handle box-shadow with  
background-clip:padding-box. WebKit continues the shadow in the gaps  
(e.g. between the dashes), and FireFox/MineField does not (not the  
version I'm looking at anyway, so maybe that is actually a bug).

Received on Wednesday, 18 February 2009 16:15:07 UTC