Permalink
Browse files

note on dashed test names in addTest.

  • Loading branch information...
paulirish committed Jan 10, 2013
1 parent ccda4c2 commit 14f895a524c12a7c324d3ae569a1ff557cfd3e42
Showing with 4 additions and 1 deletion.
  1. +4 −1 docs/index.html
View
@@ -630,7 +630,7 @@ <h3>addTest() Plugin API</h3>
<dd><code>Modernizr.<strong>addTest({str: bool, str2: fn})</strong></code></dd>
</dl>
<p>You may want to test additional features that Modernizr currently does not support. For that, you can use the addTest function. For example, some users have requested tests for IE's float double margin bug, and support for <code>position:fixed</code>. All the current tests that we've codified are <a href="https://github.com/Modernizr/Modernizr/tree/master/feature-detects">available in the GitHub</a>. Using addTest, you can add these yourself and get the exact same API as the fully supported tests.</p>
- <p>New signatures for this method of accepting a boolean or an object were added for Modernizr 2</p>
+
<h4>Sample Usage:</h4>
<pre><span class="comment">// Test for &lt;track> element support</span>
@@ -641,6 +641,9 @@ <h4>Sample Usage:</h4>
</pre>
<p>Assuming the above test passes, there will now be a <code>.track</code> class on the HTML element and <code>Modernizr.track</code> will be true. IE6, of course, will now have a <code>.no-track</code> class.</p>
+
+
+ <p><b>NOTE:</b> We recommend using a test name <em>without</em> dashes. This is to avoid a scenario where a user will access the property via awkward syntax like: <code>if (Modernizr['dashed-prop']) { ...</code>.</p>
</section>

0 comments on commit 14f895a

Please sign in to comment.