Re: [css3-background] proposed box-shadow syntax

Brad Kemper wrote:
> Actually, if I understand the spec language correctly (which it is very 
> possible that I do not), I think you might be missing some double bars, 
> and a question mark, so that the color and key words are optional and 
> their order unimportant. Would the following be more desirable?
> 
> box/text-shadow: none | [[<shadow-size> || <color>?] || [inner | 
> outer]?] [, [<shadow-def> || <color>] [inner | outer]]*
> 
> where <shadow-size> is: [[<length> <length>]? || <length>?] <length>?

(I assume you missed updating the part that comes after the comma, so you meant:
box/text-shadow: none | [[<shadow-size> || <color>?] || [inner | outer]?] [, 
[[<shadow-size> || <color>?] || [inner | outer]?]]* )

This so-called "choke" is a logical idea. That is, if we're going to specify for 
spread, we may as well specify for choke, because it is spread with a negative 
value.

All of the examples you give are legal under your rephrasing, but so is this:

box-shadow: ;

And, confusingly, this:

box-shadow: ,,,,,,,;

For that matter, the empty string is a legal <shadow-size> as well. (Studying 
regexes has given me an eye for when the empty string matches a pattern.) While 
I understand the desire to collapse this into a shorthand property (see more on 
this below), I think it's jarring to have the disconnect between what the first 
<length> represents when one <length> is given and what it represents when two 
are. (That is, blur radius changes into horizontal offset.) If the final syntax 
allows for a one-length variant (which I'm not sure I'm in favor of), I'd like 
it to be used for both the vertical and the horizontal offset, on analogy to 
padding, margin, border, etc.

Blur radius also shouldn't make the shadow any bigger than it is. Under the 
current draft of the spec (not any of our revisions to it) the following two are 
roughly the same size (but the second one is sharper):

box-shadow: 3px 2px 2px blue;
box-shadow: 4px 1px;

> I also propose that this be considered shorthand, and that we also have 
> the individual properties as follows;
> 
> box-shadow-x
> box-shadow-y
> box-shadow-blur
> box-shadow-color
> box-shadow-spread
> box-shadow-cast (e.g. "inner" or "outer")

My main objection to this is this will become difficult to coordinate when you 
specify multiple shadows. I can't think of a happy way around that. Suggestions?

Eli Morris-Heft
dai@doublefishstudios.com

Received on Saturday, 10 May 2008 05:26:18 UTC