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>The value of a <i>data property</i>may be substituted into any other property (including other data properties) by referencing it with the ''data()'' function, otherwise known as a <i>variable</i>. The syntax of the ''data()'' function is:</p>
213
+
<p>A <dfn>variable</dfn> allows the value of a <i>data property</i>on an element to be substituted into another property on the element. Variables are used with the ''data()'' function, taking the name of a variable and returning the value of the associated data property. The syntax of the ''data()'' function is:</p>
<p>The ''data()'' function references the <i>data property</i>named when the "data-" prefix is added to the argument to the function.</p>
217
+
<p>The ''data()'' function references the <i>data property</i>with the name obtained by prepending "data-" to the function's argument. <spanclass='note'>Note that all possible <i>data properties</i> exist; if one with the given name has not yet been defined in the document, it simply takes its initial value.</span> When a property resolves its computed value, a ''data()'' function is replaced by the value of the referenced <i>data property</i>.</p>
218
218
219
-
<pclass='issue'>Um, can you use a variable variable? Is ''data(data(foo))'' valid?</p>
219
+
<pclass='issue'>What about variable variables? Should ''data(data(foo))'' be valid? (Probably not.)</p>
220
220
221
221
<p>A variable can be used anywhere a value is expected in CSS. Variables can not be used as property names, selectors, or anything else besides property values - doing so either produces an invalid value or, in some situations like the attribute value of an attribute selector, a valid value that nonetheless has no relation to the variable of that name.</p>
0 commit comments