W3C home > Mailing lists > Public > www-style@w3.org > February 2012

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

From: John Daggett <jdaggett@mozilla.com>
Date: Sun, 5 Feb 2012 22:38:45 -0800 (PST)
To: Lea Verou <leaverou@gmail.com>
Cc: www-style list <www-style@w3.org>
Message-ID: <1723366754.3006251.1328510324967.JavaMail.root@zimbra1.shared.sjc1.mozilla.com>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:50 GMT