Re: [css3-fonts] Grammar for font-variant shorthand

Lea Verou wrote:

> As it currently stands, the grammar is this:
> 
> normal | inherit | [ <common-lig-values> || <discretionary-lig-values> ||
> <historical-lig-values> || <contextual-alt-values> ||
> stylistic(<feature-value-name>) || historical-forms ||
> styleset(<feature-value-name> [, <feature-value-name>]*) ||
> character-variant(<feature-value-name> [,<feature-value-name>]*) ||
> swash(<feature-value-name>) || ornaments(<feature-value-name>) ||
> annotation(<feature-value-name>) || <caps-value> || <numeric-figure-values> ||
> <numeric-spacing-values> || <numeric-fraction-values> || ordinal ||
> slashed-zero || <east-asian-variant-values> || <east-asian-width-values> ||
> ruby ]
> 
> I think it would be much more readable if it was formatted a bit better,
> especially if the tokens were grouped by property. For example:

They are listed by subproperty but the list is just too damn long.  But
point taken.

> Of course, it would be even more readable if it just listed normal | inherit |
> <...the individual properties...> like most shorthands, but I guess that has
> issues with the ambiguous `normal` value :(

The trickiness with this is the fact that *some* of the values of various
font-variant-xxx subproperties are mutually exclusive and some are not.

Valid:

  font-variant: common-ligatures no-discretionary-ligatures;

Not valid:

  font-variant: common-ligatures no-discretionary-ligatures no-common-ligatures;

Using the individual property values you'd end up with something like this:

  [aaa | bbb] || [ccc | ddd]

That would produce an even longer "production from hell"...

Cheers,

John Daggett

Received on Monday, 6 February 2012 06:49:07 UTC