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
Using Cascading Variables: the <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> notation</span><aclass=section-linkhref=#using-variables>§</a></h2>
437
+
Using Cascading Variables: the <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> notation</span><aclass=section-linkhref=#using-variables>§</a></h2>
438
438
439
439
<p> Every <ahref=#custom-property>custom property</a> automatically defines a corresponding <ahref=#cascading-variable>cascading variable</a>,
440
-
which can then be substituted into another property with the <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> function.
441
-
The syntax of <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> is:
440
+
which can then be substituted into another property with the <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> function.
441
+
The syntax of <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> is:
If the variable named by the first argument to the <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> function is a valid variable,
470
-
replace the <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> function by the value of the corresponding <ahref=#custom-property>custom property</a>.
470
+
If the variable named by the first argument to the <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> function is a valid variable,
471
+
replace the <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> function by the value of the corresponding <ahref=#custom-property>custom property</a>.
471
472
472
473
<li>
473
-
Otherwise, if the <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> function has a fallback value as its second argument,
474
-
replace the <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> function by the fallback value.
475
-
If there are any <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> references in the fallback,
474
+
Otherwise, if the <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> function has a fallback value as its second argument,
475
+
replace the <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> function by the fallback value.
476
+
If there are any <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> references in the fallback,
476
477
<ahref=#resolve-a-variabletitle="resolve a variable">resolve</a> them as well.
477
478
478
479
<li>
479
480
Otherwise,
480
-
the property containing the <aclass=cssdata-link-type=maybehref=#variable-type>var()</a> function is <ahref=#invalid-at-computed-value-time>invalid at computed-value time</a>.
481
+
the property containing the <aclass=cssdata-link-type=maybehref=#funcdef-var>var()</a> function is <ahref=#invalid-at-computed-value-time>invalid at computed-value time</a>.
481
482
482
483
<pclass=note> Note: Other things can also make a property <ahref=#invalid-at-computed-value-time>invalid at computed-value time</a>.
Abstract: This module introduces cascading variables as a new primitive value type that is accepted by all CSS properties, and custom properties for defining them.
0 commit comments