UNPKG

modernizr

Version:

Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.

30 lines (25 loc) 855 B
/*! { "name": "CSS Generated Content Animations", "property": "csspseudoanimations", "tags": ["css"] } !*/ define(['Modernizr', 'testStyles', 'test/css/animations'], function(Modernizr) { Modernizr.addTest('csspseudoanimations', function() { var result = false; if (!Modernizr.cssanimations || !window.getComputedStyle) { return result; } var styles = [ '@', Modernizr._prefixes.join('keyframes csspseudoanimations { from { font-size: 10px; } }@').replace(/\@$/, ''), '#modernizr:before { content:" "; font-size:5px;', Modernizr._prefixes.join('animation:csspseudoanimations 1ms infinite;'), '}' ].join(''); Modernizr.testStyles(styles, function(elem) { result = window.getComputedStyle(elem, ':before').getPropertyValue('font-size') === '10px'; }); return result; }); });