@@ -828,6 +828,36 @@ <h3 id=the-cssvariablesdeclaration-interface><span class=secno>4.2. </span>
828828 < var > varName</ var > as its argument, and return the returned value.
829829 Otherwise, do nothing and return the empty string.
830830
831+ < div class =example > For example, given the following style sheet:
832+ < pre > div {
833+ var-foo: 16px;
834+ var-Bar: red;
835+ var-foo-bar: 50%;
836+ }
837+ </ pre >
838+
839+ < p > The following lines of script all return something useful:
840+
841+ < pre > el = document.querySelector("div");
842+ print(el.style.var.foo); /* Prints the value of "var-foo" */
843+ print(el.style.var.Bar); /* Prints the value of "var-Bar" */
844+ print(el.style.var["foo-bar"]); /* Prints the value of "var-foo-bar" */
845+ </ pre >
846+
847+ < p > On the other hand, the following do not:
848+
849+ < pre > print(el.style.varFoo);
850+ /* Custom properties don’t exist directly on "style" */
851+
852+ print(el.style.varfoo);
853+ /* Not even if the casing matches. */
854+
855+ print(el.style.var.foo-bar);
856+ /* Retrieves "var-foo" and subtracts a JS variable named "bar",
857+ rather than retrieving the value of "var-foo-bar" */
858+ </ pre >
859+ </ div >
860+
831861 < h2 id =acknowledgments > < span class =secno > 5. </ span > Acknowledgments</ h2 >
832862
833863 < h2 id =conformance > < span class =secno > 6. </ span > Conformance</ h2 >
@@ -946,7 +976,7 @@ <h3 id=testing><span class=secno>6.5. </span> Non-experimental
946976 W3C are subject to review and correction by the CSS Working Group.
947977
948978 < p > Further information on submitting testcases and implementation reports
949- can be found from on the CSS Working Group’ s website at < a
979+ can be found from on the CSS Working Group' s website at < a
950980 href ="http://www.w3.org/Style/CSS/Test/ "> http://www.w3.org/Style/CSS/Test/</ a > .
951981 Questions should be directed to the < a
952982 href ="http://lists.w3.org/Archives/Public/public-css-testsuite "> public-css-testsuite@w3.org</ a >
0 commit comments