Re: [css-variables] allowed syntax of variable values

As of today, the the description of variable definitions in the
current ED has been changed to [1]:

> The <value> type used in the syntax above is defined as anything
> matching the "value" production in CSS 2.1 Chapter 4.1 [CSS21]. This
> puts almost no restrictions on what kinds of values you can store in
> variables. Obviously, any valid property value or component of a
> property is allowed. Additionally, this allows things that aren't yet
> valid CSS, like unknown keywords or functions, blocks, at-rules, and
> other kinds of custom micro-syntaxes like what's allowed in calc().
> There are still rules, however; for example, unbalanced parentheses
> are invalid. 

I'm much more comfortable with both this wording and the intent it seems
to capture.

The "almost no restrictions" part is still not good wording!

Change:

  The <value> type used in the syntax above is defined as anything
  matching the "value" production in CSS 2.1 Chapter 4.1 [CSS21].This
  puts almost no restrictions on what kinds of values you can store in
  variables.

To:

  The <value> type used in the syntax above is defined as anything
  matching the "value" production in the core CSS syntax defined in
  CSS 2.1 Chapter 4.1 [CSS21].  This means that variable definitions
  are valid as long as they follow this syntax, independent of whether
  the values would be valid when used in a style declaration or not.

A good example showing simple valid definitions and invalid definitions
would be nice to have following this paragraph.

One question - why use the "value" production rather than the "any"
production?  Is there a reason to allow blocks and at-rules in
variable definitions?

Regards,

John Daggett

[1] http://dvcs.w3.org/hg/csswg/raw-file/817e6e57a6eb/css-variables/Overview.html

Received on Wednesday, 30 May 2012 02:11:55 UTC