RE: [css3-background] Default shadow color

[fantasai:] 
> On 03/03/2011 02:56 PM, Sylvain Galineau wrote:
> > The color element of a box shadow is optional [1]:
> >
> > 	"...omitted colors are a UA-chosen color."
> >
> > Is there are reason not to make the shadow color currentColor as
> > opposed to 'a UA-chosen color' ? This would also apply to text-shadow
> > and make this clearly testable, at least.
> >
> > [1] http://dev.w3.org/csswg/css3-background/#the-box-shadow
> 
> http://lists.w3.org/Archives/Public/www-style/2010Dec/0426.html
> 
> currentColor is not a good color to use for shadows. It's 99.999% of the
> time the wrong color. :) And I'm pretty sure there are lots of pages out
> there depending on it being a shade of gray rather than currentColor.

I don't see how we assert it's wrong 99.999% of the time. That is entirely up 
to the author, depends on the presence/color of a border, background color of 
the content etc. 

Be that as it may, how can anyone *depend* on it being a shade of gray if 
it's undefined and UA-chosen ? If all browsers do use the same shade of gray  
then we should specify that. 

Last, I see the shadow matching currentColor in Opera 11, Firefox 4 and IE9.
(Chrome seems to have a problem with a missing color). So if someone does 
depend on getting 'a shade of gray' it seems they're broken. 

<!doctype html>
<style>
 body {
   color:yellow;
 }
.test {
   width:300px; height:200px;
   margin:10px;
   border:1px dotted black;
   box-shadow: 5px 5px 0px;
}
#test1 {   
   color:black;
}
#test2 {   
   color:red;
}
#test3 {   
   color:rgba(0,200,0,0.7);
}
#test4 {   
   color:curentColor;
}
</style>

<div class="test" id="test1">Black</div>
<div class="test" id="test2">Red</div>
<div class="test" id="test3">Green with .7 alpha</div>
<div class="test" id="test4">currentColor (yellow)</div>

Received on Friday, 4 March 2011 00:01:25 UTC