Skip to content

Commit

Permalink
Added feature detect for Object-fit
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Workman committed Aug 17, 2012
1 parent 05ddc4c commit c65294e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions feature-detects/css-objectfit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

// dev.opera.com/articles/view/css3-object-fit-object-position/

Modernizr.testStyles( '#modernizr{object-fit:cover}', function( elem ) {
var style = window.getComputedStyle ?
window.getComputedStyle( elem, null )
: elem.currentStyle;

Modernizr.addTest( 'objectfitcover', style.objectFit == 'cover' );
});

0 comments on commit c65294e

Please sign in to comment.