You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
</p><tableclass="propdef"><tbody><tr><th>Name:</th><td><dfnid="var-">var-*</dfn></td></tr><tr><th>Values:</th><td>[ <adata-autolink="link" class="production" href="#value-production"><var><value></var></a> | <adata-autolink="link" class="production" href="#cdo-production"><var><CDO></var></a> | <adata-autolink="link" class="production" href="#cdc-production"><var><CDC></var></a> ]</td></tr><tr><th>Initial:</th><td>(nothing, see prose)</td></tr><tr><th>Applies To:</th><td>all elements</td></tr><tr><th>Inherited:</th><td>yes</td></tr><tr><th>Computed Value:</th><td>specified value with variables substituted (but see prose for "invalid variables")</td></tr><tr><th>Media:</th><td>all</td></tr></tbody></table>
151
151
<p> A <dfnid="custom-property">custom property</dfn> is any property
152
152
whose name starts with "var-",
153
+
and contains at least one additional character.
153
154
and the rest of the name conforms to the grammar for an identifier <adata-autolink="biblio" U00022="" data-biblio-type="normative" title="CSS3VAL" href="#css3val">[CSS3VAL]</a>.
154
155
<adata-autolink="link" href="#custom-property">Custom properties</a> are solely for use by authors and users;
155
156
CSS will never give them a meaning beyond what is presented here.
The part of the custom property name after the "var-"
184
-
must be an identifier by itself.
185
-
This means that, for example,
186
-
<adata-autolink="maybe" class="css">var-0</a>is not a valid custom property name,
184
+
Authors are recommended to choose custom property names
185
+
so that the part after the "var-" is an identifier by itself,
186
+
so that it can be referenced without <ahref="http://www.w3.org/TR/CSS21/syndata.html#escaped-characters">character escaping</a>.
187
+
For example, <adata-autolink="property" class="property" title="var-0">var-0</a>needs to be referenced as <adata-autolink="maybe" class="css">var(\30)</a>,
187
188
because <adata-autolink="maybe" class="css">0</a> isn't a valid identifier.
189
+
(U+0030 is the hexadecimal code for the <adata-autolink="maybe" class="css">0</a> character.)
0 commit comments