Skip to content

Commit d87bb58

Browse files
committed
[css-variables] Move naming recommendation to a note.
1 parent 1e0b2fd commit d87bb58

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

css-variables/Overview.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ <h2 id="introduction" data-level="1"><span class="secno">1 </span>
154154
<a data-autolink="link" href="#custom-property">Custom properties</a> are solely for use by authors and users;
155155
CSS will never give them a meaning beyond what is presented here.
156156

157+
</p><p class="note"> Note: Authors are recommended to choose custom property names
158+
so that the part after the "var-" is an identifier by itself,
159+
so that it can be referenced without <a href="http://www.w3.org/TR/CSS21/syndata.html#escaped-characters">character escaping</a>.
160+
For example, <a data-autolink="property" class="property" title="var-0">var-0</a> needs to be referenced as <a data-autolink="maybe" class="css">var(\30)</a>,
161+
because <a data-autolink="maybe" class="css">0</a> isn't a valid identifier.
162+
(U+0030 is the hexadecimal code for the <a data-autolink="maybe" class="css">0</a> character.)
163+
157164
</p><div class="example">
158165
Custom properties define variables,
159166
referenced with the <a data-autolink="maybe" class="css">var()</a> notation,
@@ -179,15 +186,6 @@ <h2 id="introduction" data-level="1"><span class="secno">1 </span>
179186
rather than requiring many edits across all stylesheets in the webpage.
180187
</p></div>
181188

182-
<div class="example">
183-
Authors are recommended to choose custom property names
184-
so that the part after the "var-" is an identifier by itself,
185-
so that it can be referenced without <a href="http://www.w3.org/TR/CSS21/syndata.html#escaped-characters">character escaping</a>.
186-
For example, <a data-autolink="property" class="property" title="var-0">var-0</a> needs to be referenced as <a data-autolink="maybe" class="css">var(\30)</a>,
187-
because <a data-autolink="maybe" class="css">0</a> isn't a valid identifier.
188-
(U+0030 is the hexadecimal code for the <a data-autolink="maybe" class="css">0</a> character.)
189-
</div>
190-
191189
<p> Unlike other CSS properties,
192190
custom property names are <strong>case-sensitive</strong>.
193191
The "var-" prefix <strong>must</strong> be written in lower-case.
@@ -880,7 +878,7 @@ <h3 class="no-ref" id="testing">
880878

881879
<h3 id="normative" class="no-num no-ref">
882880
Normative References</h3>
883-
<div data-fill-with="normative-references"><dl><dt id="css21" title="CSS21">[CSS21]</dt><dd>Bert Bos; et al. <a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a></dd><dt id="rfc2119" title="RFC2119">[RFC2119]</dt><dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt">Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a></dd></dl></div>
881+
<div data-fill-with="normative-references"><dl><dt id="rfc2119" title="RFC2119">[RFC2119]</dt><dd>S. Bradner. <a href="http://www.ietf.org/rfc/rfc2119.txt">Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <a href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a></dd><dt id="css21" title="CSS21">[CSS21]</dt><dd>Bert Bos; et al. <a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a>. 7 June 2011. W3C Recommendation. URL: <a href="http://www.w3.org/TR/2011/REC-CSS2-20110607/">http://www.w3.org/TR/2011/REC-CSS2-20110607/</a></dd></dl></div>
884882

885883
<h3 id="informative" class="no-num no-ref">
886884
Informative References</h3>

css-variables/Overview.src.html

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ <h2 id='defining-variables'>
7979
<a>Custom properties</a> are solely for use by authors and users;
8080
CSS will never give them a meaning beyond what is presented here.
8181

82+
Note: Authors are recommended to choose custom property names
83+
so that the part after the "var-" is an identifier by itself,
84+
so that it can be referenced without <a href="http://www.w3.org/TR/CSS21/syndata.html#escaped-characters">character escaping</a>.
85+
For example, 'var-0' needs to be referenced as ''var(\30)'',
86+
because ''0'' isn't a valid identifier.
87+
(U+0030 is the hexadecimal code for the ''0'' character.)
88+
8289
<div class='example'>
8390
Custom properties define variables,
8491
referenced with the ''var()'' notation,
@@ -106,15 +113,6 @@ <h2 id='defining-variables'>
106113
rather than requiring many edits across all stylesheets in the webpage.
107114
</div>
108115

109-
<div class='example'>
110-
Authors are recommended to choose custom property names
111-
so that the part after the "var-" is an identifier by itself,
112-
so that it can be referenced without <a href="http://www.w3.org/TR/CSS21/syndata.html#escaped-characters">character escaping</a>.
113-
For example, 'var-0' needs to be referenced as ''var(\30)'',
114-
because ''0'' isn't a valid identifier.
115-
(U+0030 is the hexadecimal code for the ''0'' character.)
116-
</div>
117-
118116
Unlike other CSS properties,
119117
custom property names are <strong>case-sensitive</strong>.
120118
The "var-" prefix <strong>must</strong> be written in lower-case.

0 commit comments

Comments
 (0)