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> This specification defines an open-ended set of properties called <ahref=#custom-property>custom properties</a>,
147
147
which are used to define <ahref=#cascading-variable>variables</a>.
148
148
149
-
<tableclass=propdef><tr><th>Name:<td><dfndata-dfn-type=propertydata-export="" id=propdef-var->var-*<aclass=self-linkhref=#></a></dfn><tr><th>Value:<td><aclass=productiondata-link-type=typehref=#typedef-any-value><any-value></a><tr><th>Initial:<td>(nothing, see prose)<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Media:<td>all<tr><th>Computed value:<td>specified value with variables substituted (but see prose for "invalid variables")<tr><th>Animatable:<td>no</table>
149
+
<tableclass=propdef><tr><th>Name:<td><dfndata-dfn-type=propertydata-export="" id=propdef-var->var-*<aclass=self-linkhref=#propdef-var-></a></dfn><tr><th>Value:<td><aclass=productiondata-link-type=typehref=#typedef-any-value><any-value></a><tr><th>Initial:<td>(nothing, see prose)<tr><th>Applies to:<td>all elements<tr><th>Inherited:<td>yes<tr><th>Media:<td>all<tr><th>Computed value:<td>specified value with variables substituted (but see prose for "invalid variables")<tr><th>Animatable:<td>no</table>
Custom Property Value Syntax</span><aclass=self-linkhref=#syntax></a></h3>
219
219
220
220
<p> The allowed syntax for <ahref=#custom-property>custom properties</a> is extremely permissive.
221
-
The <dfndata-dfn-type=typedata-export="" id=typedef-any-value><any-value><aclass=self-linkhref=#></a></dfn> production matches <em>any</em> sequence of one or more tokens,
221
+
The <dfndata-dfn-type=typedata-export="" id=typedef-any-value><any-value><aclass=self-linkhref=#typedef-any-value></a></dfn> production matches <em>any</em> sequence of one or more tokens,
Using Custom Properties</span><aclass=self-linkhref=#using></a></h3>
273
273
274
274
<p> The primary purpose of <ahref=#custom-property>custom properties</a> is to define <ahref=#cascading-variable>cascading variables</a>.
275
-
In CSS, a <dfndata-dfn-type=dfndata-noexport="" id=cascading-variabletitle="variable|cascading variable">cascading variable<aclass=self-linkhref=#></a></dfn> is a value that can be substituted into other properties,
275
+
In CSS, a <dfndata-dfn-type=dfndata-noexport="" id=cascading-variabletitle="variable|cascading variable">cascading variable<aclass=self-linkhref=#cascading-variable></a></dfn> is a value that can be substituted into other properties,
276
276
allowing authors to "abstract" parts of their page’s CSS out
277
277
and reuse it in several places.
278
278
Every <ahref=#custom-property>custom property</a> defines a corresponding <ahref=#cascading-variable>variable</a>
after variable references have been <ahref=#resolve-a-variabletitle="resolve a variable">resolved</a>.
461
461
462
-
<p> To <dfndata-dfn-type=dfndata-noexport="" id=resolve-a-variable>resolve a variable<aclass=self-linkhref=#></a></dfn> in a property’s value:
462
+
<p> To <dfndata-dfn-type=dfndata-noexport="" id=resolve-a-variable>resolve a variable<aclass=self-linkhref=#resolve-a-variable></a></dfn> in a property’s value:
<p> When a <ahref=#custom-property>custom property</a> has its initial value,
573
573
the <ahref=#cascading-variable>variable</a> it defines
574
-
represents an <dfndata-dfn-type=dfndata-noexport="" id=invalid-variable>invalid variable<aclass=self-linkhref=#></a></dfn>.
574
+
represents an <dfndata-dfn-type=dfndata-noexport="" id=invalid-variable>invalid variable<aclass=self-linkhref=#invalid-variable></a></dfn>.
575
575
Using an <ahref=#invalid-variable>invalid variable</a> in a property value
576
576
(including other <ahref=#custom-property>custom properties</a>)
577
577
makes the declaration <ahref=#invalid-at-computed-value-time>invalid at computed-value time</a>.
578
578
579
-
<p> A declaration can be <dfndata-dfn-type=dfndata-noexport="" id=invalid-at-computed-value-time>invalid at computed-value time<aclass=self-linkhref=#></a></dfn>
579
+
<p> A declaration can be <dfndata-dfn-type=dfndata-noexport="" id=invalid-at-computed-value-time>invalid at computed-value time<aclass=self-linkhref=#invalid-at-computed-value-time></a></dfn>
580
580
if it uses an invalid <ahref=#cascading-variable>variable</a>, as explained above,
581
581
or if it uses a valid <ahref=#cascading-variable>variable</a>,
Extensions to the <code>CSSStyleDeclaration</code> Interface</span><aclass=self-linkhref=#the-cssstyledeclaration-interface></a></h3>
640
640
641
-
<p> The <dfndata-dfn-type=dfndata-noexport="" id=cssstyledeclaration><code>CSSStyleDeclaration</code><aclass=self-linkhref=#></a></dfn> interface is amended as follows:
641
+
<p> The <dfndata-dfn-type=dfndata-noexport="" id=cssstyledeclaration><code>CSSStyleDeclaration</code><aclass=self-linkhref=#cssstyledeclaration></a></dfn> interface is amended as follows:
<p> A <code>CSSStyleDeclaration</code> is the <dfndata-dfn-type=dfndata-noexport="" id=associated-style-declaration>associated style declaration<aclass=self-linkhref=#></a></dfn>
647
+
<p> A <code>CSSStyleDeclaration</code> is the <dfndata-dfn-type=dfndata-noexport="" id=associated-style-declaration>associated style declaration<aclass=self-linkhref=#associated-style-declaration></a></dfn>
648
648
for the <code>CSSVariablesMap</code> assigned to its <code>var</code> attribute.
649
649
650
650
<p> While the CSSStyleDeclaration interface normally contains attributes that are camel-cased name variants of all CSS properties
The <code>CSSVariablesMap</code> Interface</span><aclass=self-linkhref=#the-CSSVariablesMap-interface></a></h3>
672
672
673
-
<p> The <dfndata-dfn-type=dfndata-noexport="" id=cssvariablesmap><code>CSSVariablesMap</code><aclass=self-linkhref=#></a></dfn> interface
673
+
<p> The <dfndata-dfn-type=dfndata-noexport="" id=cssvariablesmap><code>CSSVariablesMap</code><aclass=self-linkhref=#cssvariablesmap></a></dfn> interface
674
674
exposes the <ahref=#custom-property>custom properties</a> declared in the parent declaration block
<p> The <ahref=http://dev.w3.org/2006/webapi/WebIDL/#MapClass>map entries</a>
686
686
on a CSSVariablesMap object
687
-
are the property names of all the <ahref=#custom-property>custom properties</a> in the <ahref=http://dev.w3.org/csswg/cssom/#css-declaration-block-declarations><dfndata-dfn-type=dfndata-noexport="" id=css-declaration-block-declarations>CSS declaration block declarations<aclass=self-linkhref=#></a></dfn></a>
687
+
are the property names of all the <ahref=#custom-property>custom properties</a> in the <ahref=http://dev.w3.org/csswg/cssom/#css-declaration-block-declarations><dfndata-dfn-type=dfndata-noexport="" id=css-declaration-block-declarations>CSS declaration block declarations<aclass=self-linkhref=#css-declaration-block-declarations></a></dfn></a>
<divdata-fill-with=normative-references><dl><dtid=css21title=CSS21>[CSS21]<dd>Bert Bos; et al. <ahref=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: <ahref=http://www.w3.org/TR/2011/REC-CSS2-20110607/>http://www.w3.org/TR/2011/REC-CSS2-20110607/</a><dtid=rfc2119title=RFC2119>[RFC2119]<dd>S. Bradner. <ahref=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <ahref=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dl></div>
945
+
<divdata-fill-with=normative-references><dl><dtid=css21title=CSS21><aclass=self-linkhref=#css21></a>[CSS21]<dd>Bert Bos; et al. <ahref=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: <ahref=http://www.w3.org/TR/2011/REC-CSS2-20110607/>http://www.w3.org/TR/2011/REC-CSS2-20110607/</a><dtid=rfc2119title=RFC2119><aclass=self-linkhref=#rfc2119></a>[RFC2119]<dd>S. Bradner. <ahref=http://www.ietf.org/rfc/rfc2119.txt>Key words for use in RFCs to Indicate Requirement Levels</a>. URL: <ahref=http://www.ietf.org/rfc/rfc2119.txt>http://www.ietf.org/rfc/rfc2119.txt</a></dl></div>
<divdata-fill-with=informative-references><dl><dtid=css3colortitle=CSS3COLOR>[CSS3COLOR]<dd>Tantek Çelik; Chris Lilley; L. David Baron. <ahref=http://www.w3.org/TR/2011/REC-css3-color-20110607>CSS Color Module Level 3</a>. 7 June 2011. W3C Recommendation. URL: <ahref=http://www.w3.org/TR/2011/REC-css3-color-20110607>http://www.w3.org/TR/2011/REC-css3-color-20110607</a></dl></div>
949
+
<divdata-fill-with=informative-references><dl><dtid=css3colortitle=CSS3COLOR><aclass=self-linkhref=#css3color></a>[CSS3COLOR]<dd>Tantek Çelik; Chris Lilley; L. David Baron. <ahref=http://www.w3.org/TR/2011/REC-css3-color-20110607>CSS Color Module Level 3</a>. 7 June 2011. W3C Recommendation. URL: <ahref=http://www.w3.org/TR/2011/REC-css3-color-20110607>http://www.w3.org/TR/2011/REC-css3-color-20110607</a></dl></div>
0 commit comments