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

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

From: John Daggett <jdaggett@mozilla.com>
Date: Tue, 29 May 2012 19:11:26 -0700 (PDT)
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, www-style@w3.org, "L. David Baron" <dbaron@dbaron.org>
Message-ID: <1241425307.23077002.1338343886168.JavaMail.root@mozilla.com>

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 GMT

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