Re: [css3-background] box-shadow syntax

On May 8, 2008, at 9:48 AM, Eli Morris-Heft wrote:

> Alan Gresley wrote:
>> Understanding, Thank you. How about:
>> 4px(inner)
>> 4px(outer)
>> and
>> 4px
>> for a even blur.
> I want to remind everyone that we're talking about a shadow here,  
> not a blur surrounding the element in question, so the expectation  
> is for a shadow, outside and to one side of the object. To get an  
> outer glow, we need:
> box-shadow: 2px 2px 1px black, 2px -2px 1px black, -2px 2px 1px  
> black, -2px -2px 1px black;
> To get an inside glow, we should (under Brad's suggestion) have:
> box-shadow: 2px 2px -1px black, 2px -2px -1px black, -2px 2px -1px  
> black, -2px -2px -1px black;

Sorry if I was not clear, or if I misspoke somewhere. I was not  
suggesting this as a war to get a glow, but just as a way to get an  
inner shadow without creating a new property or keyword.

For a glow, I think you can do it somewhat with something like this:

box-shadow: 0 0 10px black;

but without some sort of "spread" value, it is pretty limited. But  
that is more of a separate discussion than what I was trying to do  
with any angle cast shadows.

> While I feel that this is a step towards something we want in the  
> spec, are we sure we want to define this this way? Under the current  
> wording, a negative number would indicate a sharper-than-perfectly- 
> sharp shadow, and that makes little sense. Plus, there is then no  
> way to indicate a perfectly-sharp inner shadow. (Negative 0, anyone?  
> Hey, where's everyone going? ^^;; )

Ah, good point, I must admit. Darn. I'm not actually against using -0  
to mean a perfectly sharp inner shadow, but it does complicate the  
implementation, I would imagine.

> Much as I hate to suggest adding another keyword for this, I agree  
> that we probably need inner and outer here, but I'm not sure why  
> you've suggested that syntax. I may be rusty on my CSS, but I don't  
> think <length>(keyword) appears anywhere else. Hence:
> box-shadow: none | <shadow> [inner | outer] [, <shadow> [inner |  
> outer]]*
> where <shadow> is: [<length> <length> <length>? || <color>]
> I was (and still am) tempted to have '[inner | outer]' be optional  
> and default of outer, due to the expectation for a shadow behind and  
> outside the object, rather than on top of and within. Perhaps we  
> need to (re)define shadow?

Yes, adding "inner" and "outer" as additional parameters of the box- 
shadow/text-shadow value (with a default of "outer") would be more  
obvious. That might be a better way to go.

Received on Thursday, 8 May 2008 17:07:10 UTC