|
22 | 22 |
|
23 | 23 | <h1>CSS Variables Module Level 1</h1> |
24 | 24 |
|
25 | | - <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 8 November |
| 25 | + <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 10 November |
26 | 26 | 2011</h2> |
27 | 27 |
|
28 | 28 | <dl> |
29 | 29 | <dt>This version: |
30 | 30 |
|
31 | 31 | <dd><a |
32 | | - href="http://www.w3.org/TR/2011/ED-css-variables-20111108/">http://dev.w3.org/csswg/css-variables/</a> |
| 32 | + href="http://www.w3.org/TR/2011/ED-css-variables-20111110/">http://dev.w3.org/csswg/css-variables/</a> |
33 | 33 | <!--<dt>Latest version: |
34 | 34 | <dd><a href="http://www.w3.org/TR/css-variables/">http://www.w3.org/TR/css-variables/</a>--> |
35 | 35 |
|
@@ -242,8 +242,7 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables |
242 | 242 | <tr> |
243 | 243 | <th>Values: |
244 | 244 |
|
245 | | - <td> |
246 | | - <div class=issue>Figure this out - restricted or wide-open</div> |
| 245 | + <td>see prose |
247 | 246 |
|
248 | 247 | <tr> |
249 | 248 | <th>Initial: |
@@ -273,16 +272,47 @@ <h2 id=defining-variables><span class=secno>2. </span> Defining Variables |
273 | 272 | </table> |
274 | 273 |
|
275 | 274 | <p><em>Any</em> property name starting with the prefix "data-" is a <a |
276 | | - href="#data-property"><i>data property</i></a>. <span class=issue>Spec |
277 | | - what values a data property can have.</span> Data properties are defined |
278 | | - to be valid but meaningless as they are meant solely for allowing authors |
279 | | - to pass custom data around their page, similar to the <a |
| 275 | + href="#data-property"><i>data property</i></a>. Data properties are |
| 276 | + defined to be valid but meaningless as they are meant solely for allowing |
| 277 | + authors to pass custom data around their page, similar to the <a |
280 | 278 | href="http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data-with-the-data-*-attributes">custom |
281 | 279 | data attributes</a> in HTML. Other specifications and user agents must not |
282 | 280 | assign a particular meaning to data properties or attach a specific effect |
283 | 281 | to them beyond the bare minimum that comes from them being valid |
284 | 282 | properties. |
285 | 283 |
|
| 284 | + <p>The valid possible values of a data property are almost completely |
| 285 | + unrestricted. A data property can contain anything that is valid according |
| 286 | + to the <code>value</code> production in the <a |
| 287 | + href="http://www.w3.org/TR/CSS2/syndata.html#tokenization">CSS Core |
| 288 | + Grammar</a>. The values do not have to correspond to any existing CSS |
| 289 | + values, as they are not evaluated except to replace variables occuring |
| 290 | + within them until they are actually referenced in a normal property with a |
| 291 | + variable. |
| 292 | + |
| 293 | + <p>This specification reserves the use of all function tokens starting with |
| 294 | + the prefix "data" within data properties. Authors must not use any such |
| 295 | + functions except as defined in this specification or future updates. If a |
| 296 | + data property contains such a function, it must match the grammar defined |
| 297 | + in this specification or future updates; the use of such a function that |
| 298 | + does not follow the grammar, or that utilizes such a function that is not |
| 299 | + yet defined, makes the data property invalid and it must be ignored. |
| 300 | + |
| 301 | + <div class=example> |
| 302 | + <p>For example, even though this spec doesn't define a ‘<code |
| 303 | + class=css>data-inherit()</code>’ function, that name is reserved by |
| 304 | + default and cannot be used. Similarly, the ‘<code |
| 305 | + class=css>data()</code>’ function <em>is</em> defined by this spec, |
| 306 | + so any use of it must match the definition in the spec. The following |
| 307 | + property declarations are thus invalid:</p> |
| 308 | + |
| 309 | + <pre> |
| 310 | +:root { |
| 311 | + data-foo: data-inherit(bar); /* Use of reserved, but undefined, function. */ |
| 312 | + data-foo: data(bar, baz, qux); /* Invalid use of data() function. */ |
| 313 | +}</pre> |
| 314 | + </div> |
| 315 | + |
286 | 316 | <p>For each <a href="#data-property"><i>data property</i></a>, there is an |
287 | 317 | associated variable with the same name save for the "data-" prefix. For |
288 | 318 | example, a data property named "data-foo" is associated with the variable |
@@ -468,9 +498,6 @@ <h2 id=using-variables><span class=secno>3. </span> Using Variables: the |
468 | 498 | function is replaced by the value of the referenced <a |
469 | 499 | href="#data-property"><i>data property</i></a>. |
470 | 500 |
|
471 | | - <p class=issue>What about variable variables? Should ‘<code |
472 | | - class=css>data(data(foo))</code>’ be valid? (Probably not.) |
473 | | - |
474 | 501 | <p>A variable can be used anywhere a value is expected in CSS. Variables |
475 | 502 | can not be used as property names, selectors, or anything else besides |
476 | 503 | property values - doing so either produces an invalid value or, in some |
@@ -895,7 +922,7 @@ <h2 class=no-num id=property-index>Property index</h2> |
895 | 922 | <tr> |
896 | 923 | <th><span class=property>data-*</span> |
897 | 924 |
|
898 | | - <td>Figure this out - restricted or wide-open |
| 925 | + <td>see prose |
899 | 926 |
|
900 | 927 | <td>invalid (a keyword, but see prose) |
901 | 928 |
|
|
0 commit comments