Skip to content

Instantly share code, notes, and snippets.

@ryanseddon
Created April 24, 2011 00:51
Show Gist options
  • Save ryanseddon/939186 to your computer and use it in GitHub Desktop.
Save ryanseddon/939186 to your computer and use it in GitHub Desktop.
Modernizr CSS3 Generated Content test
// Using the new exposed styleElem method we can hook into the internal DOM injection code that modernizr uses.
// This make doings tests like this easy!
// Opera is currently the only browser to support CSS3 generated content, which will replace all the elements content
// with the content properties value.
Modernizr.addTest('css3generatedcontent', function () {
var bool;
Modernizr.testStyles("#modernizr { content:':)' }",function(node){
bool = node.offsetHeight >=1;
});
return bool;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment