Re: [css3-values] value syntax

L. David Baron wrote:
> On Tuesday 2009-01-27 14:02 -0800, fantasai wrote:
>> I think we should copy over the definition of our syntax notation in CSS2.1
>> section 1.4.2.1 <http://www.w3.org/TR/CSS21/about.html#property-defs> into
>> the CSS3 Values and Units spec... and add a definition for a '&&' combinator
>> which is equivalent to '||' except both sides are required. This will make
>> it easier to describe various compound value syntaxes.
> 
> For what properties do we have cases where multiple values are
> required that can come in any order?

Examples from CSS3 Backgrounds and Borders:

For box-shadow (and text-shadow, etc. ) can replace:

   [ inset? [ <length>{2,4} <color>? | <color>? <length>{2,4} ] ]
   | [ [ <length>{2,4} <color>? | <color>? <length>{2,4} ] inset? ]

with

   [ <length>{2,4} && <color>? ] && inset?

and for border-image can replace:

   none | [ <image> [ <number> | <percentage>]{1,4} [ / <border-width>{1,4} ]? ]
          [ stretch | repeat | round ]{0,2}
        | [ stretch | repeat | round ]{0,2}
          [ <image> [ <number> | <percentage>]{1,4} [ / <border-width>{1,4} ]? ]

with

   none | [ <image> [ <number> | <percentage>]{1,4} [ / <border-width>{1,4} ]? ]
          && [ stretch | repeat | round ]{0,2}

~fantasai

Received on Thursday, 5 March 2009 01:23:57 UTC