Add feature detect for checked pseudo selector #879
Conversation
|
Duplicate of #767 - could you comment on differences between the two implementations? |
|
I couldn't find #767 when looking for this feature test.
Except for implementation details the tests are equivalent. |
| !*/ | ||
| define(['Modernizr', 'createElement', 'testStyles'], function( Modernizr, createElement, testStyles ) { | ||
| Modernizr.addTest('checked', function(){ | ||
| return Modernizr.testStyles('#modernizr input {width:100px} #modernizr :checked {width:200px;display:block}', function(elem, rule){ |
stucox
Mar 26, 2013
Member
Don't need Modernizr. here, can just use return testStyles(... because it's being passed into the module as a dependency
Don't need Modernizr. here, can just use return testStyles(... because it's being passed into the module as a dependency
| define(['Modernizr', 'createElement', 'testStyles'], function( Modernizr, createElement, testStyles ) { | ||
| Modernizr.addTest('checked', function(){ | ||
| return Modernizr.testStyles('#modernizr input {width:100px} #modernizr :checked {width:200px;display:block}', function(elem, rule){ | ||
| var cb = document.createElement('input'); |
stucox
Mar 26, 2013
Member
Don't need document. here - as above.
Don't need document. here - as above.
|
Great, thanks! |
Add feature detect for checked pseudo selector
|
Why cant i see css-checked in the custom build options? |
|
It is in master, which is 3.0. It hasn't been added to the 2.7 branch If you need it, you will either need to manually edit your modernizr, or really sorry for the inconvenience :/ On Tue, Jan 7, 2014 at 10:14 AM, adrianjacob-o2 notifications@github.comwrote:
patrick |
Add feature detect for checked pseudo selector
When using input elements to store the state of your css classes it is very useful to know if you can use the feature or not.