Skip to content

Commit

Permalink
Added DOC block with description of how the test works
Browse files Browse the repository at this point in the history
  • Loading branch information
emilchristensen committed Jun 28, 2013
1 parent 1fe1e83 commit e103629
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions feature-detects/css/nthchild.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
"warnings": "Known false negative in Safari 3.1 and Safari 3.2.2"
}
!*/
/* DOC
## Detects support for the ':nth-child()' css pseudo-selector.
###How it works
5 `<div>` elements with `1px` width is created. Then every other element has its `width` set to `2px`. A Javascript lopp then tests if the `<div>`'s has the expected width using the modulus operator.
*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
testStyles('#modernizr div {width:1px} #modernizr div:nth-child(2n) {width:2px;}', function( elem ) {
Modernizr.addTest('nthchild', function () {
Expand Down

0 comments on commit e103629

Please sign in to comment.