W3C home > Mailing lists > Public > public-css-commits@w3.org > September 2011

csswg/css-variables Overview.html,1.11,1.12 Overview.src.html,1.11,1.12

From: Tab Atkins Jr.. via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 30 Sep 2011 21:54:43 +0000
To: public-css-commits@w3.org
Message-Id: <E1R9l2Z-0006gY-Bi@lionel-hutz.w3.org>
Update of /sources/public/csswg/css-variables
In directory hutz:/tmp/cvs-serv25666

Modified Files:
	Overview.html Overview.src.html 
Log Message:
Added note further explaining the variable model, per feedback from dbaron.

Index: Overview.html
===================================================================
RCS file: /sources/public/csswg/css-variables/Overview.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Overview.html	30 Sep 2011 20:39:52 -0000	1.11
+++ Overview.html	30 Sep 2011 21:54:41 -0000	1.12
@@ -372,6 +372,20 @@
    href="#invalid-at-computed-value-time"><i>invalid at computed-value
    time</i></a>.
 
+  <div class=note>
+   <p>I'm not sure how to precisely define where/how variables can be used.
+    The Grammar section has a perfect definition, it weren't all
+    non-normative (because it's just extending the 2.1 grammar). I don't know
+    if 2.1 actually has a term for what is represented by the "term"
+    production in the 2.1 grammar.</p>
+
+   <p>Basically, though, variables are lexically substituted into the
+    property value, with restrictions on where they can appear as implied by
+    the Grammar section. You can't, for example, do something ridiculous like
+    &lsquo;<code class=css>@var $unit px; div { width: 20$unit;
+    }</code>&rsquo;.</p>
+  </div>
+
   <div class=example>
    <p>For example, the following usage is fine from a syntax standpoint, but
     results in nonsense when the variable is substituted in:</p>

Index: Overview.src.html
===================================================================
RCS file: /sources/public/csswg/css-variables/Overview.src.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Overview.src.html	30 Sep 2011 20:39:52 -0000	1.11
+++ Overview.src.html	30 Sep 2011 21:54:41 -0000	1.12
@@ -141,7 +141,13 @@
 
 	<p>A variable is substituted for its value in the property value at computed-value time.  If a declaration, once all variables are substituted in, is invalid, the declaration is <i>invalid at computed-value time</i>.</p>
 
-		<div class='example'>
+	<div class='note'>
+		<p>I'm not sure how to precisely define where/how variables can be used.  The Grammar section has a perfect definition, it weren't all non-normative (because it's just extending the 2.1 grammar).  I don't know if 2.1 actually has a term for what is represented by the "term" production in the 2.1 grammar.</p>
+
+		<p>Basically, though, variables are lexically substituted into the property value, with restrictions on where they can appear as implied by the Grammar section.  You can't, for example, do something ridiculous like ''@var $unit px; div { width: 20$unit; }''.</p>
+	</div>
+
+	<div class='example'>
 		<p>For example, the following usage is fine from a syntax standpoint, but results in nonsense when the variable is substituted in:</p>
 
 		<pre>
Received on Friday, 30 September 2011 21:54:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 30 September 2011 21:54:49 GMT