|
1 | | -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| 1 | +<!DOCTYPE html> |
2 | 2 | <html lang="en"><head> |
3 | 3 | <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> |
4 | 4 | <title>CSS Custom Properties for Cascading Variables Module Level 1</title> |
@@ -147,11 +147,11 @@ <h2 id="introduction" data-level="1"><span class="secno">1 </span> |
147 | 147 | </p><h3 id="values" data-level="1.2"><span class="secno">1.2 </span> |
148 | 148 | Values</h3> |
149 | 149 |
|
150 | | -<p> This specification follows the <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property definition conventions</a> from <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>. |
151 | | - Value types not defined in this specification are defined in CSS Level 2 Revision 1 <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>. |
| 150 | +<p> This specification follows the <a href="http://www.w3.org/TR/CSS21/about.html#property-defs">CSS property definition conventions</a> from <a data-autolink="biblio" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>. |
| 151 | + Value types not defined in this specification are defined in CSS Level 2 Revision 1 <a data-autolink="biblio" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>. |
152 | 152 | Other CSS modules may expand the definitions of these value types: |
153 | 153 | for example if the <a data-autolink="link" class="production"><var><color></var></a> type was used in this specification, |
154 | | - then <a data-autolink="biblio" U00022="" data-biblio-type="informative" title="CSS3COLOR" href="#css3color">[CSS3COLOR]</a> would expand its definition. |
| 154 | + then <a data-autolink="biblio" data-biblio-type="informative" title="CSS3COLOR" href="#css3color">[CSS3COLOR]</a> would expand its definition. |
155 | 155 |
|
156 | 156 |
|
157 | 157 | </p><h2 id="defining-variables" data-level="2"><span class="secno">2 </span> |
@@ -217,7 +217,7 @@ <h2 id="introduction" data-level="1"><span class="secno">1 </span> |
217 | 217 | accepting any value that the core syntax of CSS allows, |
218 | 218 | plus the CDO and CDC tokens (written "<!--" and "-->"). |
219 | 219 | The <dfn id="value-production"><value></dfn> in its grammar corresponds to the "value" production |
220 | | - in <a href="http://www.w3.org/TR/CSS2/syndata.html#tokenization">CSS 2.1 Chapter 4.1</a> <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>, |
| 220 | + in <a href="http://www.w3.org/TR/CSS2/syndata.html#tokenization">CSS 2.1 Chapter 4.1</a> <a data-autolink="biblio" data-biblio-type="normative" title="CSS21" href="#css21">[CSS21]</a>, |
221 | 221 | while <dfn id="cdo-production"><CDO></dfn> and <dfn id="cdc-production"><CDC></dfn> correspond to the tokens of the same name |
222 | 222 | from the same chapter. |
223 | 223 |
|
@@ -361,20 +361,20 @@ <h2 id="introduction" data-level="1"><span class="secno">1 </span> |
361 | 361 | two { var-bar: calc(var(foo) + 10px); } |
362 | 362 | three { var-foo: calc(var(bar) + 10px); } |
363 | 363 | </pre> |
364 | | -<p> The <one> element defines a value for <a data-autolink="property" class="property" title="var-foo">var-foo</a>. |
365 | | - The <two> element inherits this value, |
| 364 | +<p> The <one> element defines a value for <a data-autolink="property" class="property" title="var-foo">var-foo</a>. |
| 365 | + The <two> element inherits this value, |
366 | 366 | and additionally assigns a value to <a data-autolink="property" class="property" title="var-bar">var-bar</a> using the <a data-autolink="maybe" class="css">foo</a> variable. |
367 | 367 | Finally, |
368 | | - the <three> element inherits the <a data-autolink="property" class="property" title="var-bar">var-bar</a> value |
369 | | - </three></two></one><em>after</em> variable substitution |
| 368 | + the <three> element inherits the <a data-autolink="property" class="property" title="var-bar">var-bar</a> value |
| 369 | + <em>after</em> variable substitution |
370 | 370 | (in other words, it sees the value <a data-autolink="maybe" class="css">calc(10px + 10px)</a>), |
371 | 371 | and then redefines <a data-autolink="property" class="property" title="var-foo">var-foo</a> in terms of that value. |
372 | | - Since the value it inherited for <a data-autolink="property" class="property" title="var-bar">var-bar</a> no longer contains a reference to the <a data-autolink="property" class="property" title="var-foo">var-foo</a> property defined on <one>, |
| 372 | + Since the value it inherited for <a data-autolink="property" class="property" title="var-bar">var-bar</a> no longer contains a reference to the <a data-autolink="property" class="property" title="var-foo">var-foo</a> property defined on <one>, |
373 | 373 | defining <a data-autolink="property" class="property" title="var-foo">var-foo</a> using the <a data-autolink="maybe" class="css">var(bar)</a> variable is not cyclic, |
374 | 374 | and actually defines a value that will eventually |
375 | 375 | (when referenced as a variable in a normal property) |
376 | 376 | resolve to <a data-autolink="maybe" class="css">30px</a>. |
377 | | - </one></p></div> |
| 377 | + </p></div> |
378 | 378 |
|
379 | 379 |
|
380 | 380 | <!-- |
@@ -582,12 +582,12 @@ <h2 id="using-variables" data-level="3"><span class="secno">3 </span> |
582 | 582 | p { background-color: red; } |
583 | 583 | p { background-color: var(not-a-color); } |
584 | 584 | </pre> |
585 | | -<p> the <p> elements will have transparent backgrounds |
| 585 | +<p> the <p> elements will have transparent backgrounds |
586 | 586 | (the initial value for <a data-autolink="property" class="property" title="background-color">background-color</a>), |
587 | 587 | rather than red backgrounds. |
588 | 588 | The same would happen if the variable itself was invalid. |
589 | 589 |
|
590 | | -</p></p><p> Note the difference between this |
| 590 | +</p><p> Note the difference between this |
591 | 591 | and what happens if the author had just written <a data-autolink="maybe" class="css">background-color: 20px</a> directly in their stylesheet - |
592 | 592 | that would be a normal syntax error, |
593 | 593 | which would cause the rule to be discarded, |
@@ -696,10 +696,15 @@ <h3 id="the-cssstyledeclaration-interface" data-level="4.1"><span class="secno"> |
696 | 696 | Otherwise, do nothing and return the empty string. |
697 | 697 |
|
698 | 698 | </p><div class="example"> |
699 | | - For example, |
| 699 | + <style scoped=""> |
| 700 | + #var-code-examples td { padding: 2px; } |
| 701 | + #var-code-examples code { background: rgba(0,0,0,.05); display: inline-block; padding: 1px 2px; white-space: pre; } |
| 702 | + </style> |
| 703 | + |
| 704 | +<p> For example, |
700 | 705 | given the following style sheet: |
701 | 706 |
|
702 | | - <pre>div { |
| 707 | + </p><pre>div { |
703 | 708 | var-foo: 16px; |
704 | 709 | var-Bar: red; |
705 | 710 | var-foo-bar: 50%; |
@@ -744,10 +749,6 @@ <h3 id="the-cssstyledeclaration-interface" data-level="4.1"><span class="secno"> |
744 | 749 | and subtracts some unrelated JavaScript variable named "bar" from it, |
745 | 750 | rather than just retrieving the value of <a data-autolink="property" class="property" title="var-foo-bar">var-foo-bar</a>. |
746 | 751 | </td></tr></tbody></table> |
747 | | - <style scoped=""> |
748 | | - #var-code-examples td { padding: 2px; } |
749 | | - #var-code-examples code { background: rgba(0,0,0,.05); display: inline-block; padding: 1px 2px; white-space: pre; } |
750 | | - </style> |
751 | 752 | </div> |
752 | 753 |
|
753 | 754 | <div class="example"> |
@@ -806,7 +807,7 @@ <h3 class="no-ref" id="conventions"> |
806 | 807 | letters in this specification. |
807 | 808 |
|
808 | 809 | </p><p>All of the text of this specification is normative except sections |
809 | | - explicitly marked as non-normative, examples, and notes. <a data-autolink="biblio" U00022="" data-biblio-type="normative" title="RFC2119" href="#rfc2119">[RFC2119]</a></p> |
| 810 | + explicitly marked as non-normative, examples, and notes. <a data-autolink="biblio" data-biblio-type="normative" title="RFC2119" href="#rfc2119">[RFC2119]</a></p> |
810 | 811 |
|
811 | 812 | <p>Examples in this specification are introduced with the words "for example" |
812 | 813 | or are set apart from the normative text with <code>class="example"</code>, |
|
0 commit comments