diff options
Diffstat (limited to 'source/bower_components/modernizr/feature-detects/css-vminunit.js')
-rw-r--r-- | source/bower_components/modernizr/feature-detects/css-vminunit.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/bower_components/modernizr/feature-detects/css-vminunit.js b/source/bower_components/modernizr/feature-detects/css-vminunit.js new file mode 100644 index 0000000..e6b9881 --- /dev/null +++ b/source/bower_components/modernizr/feature-detects/css-vminunit.js @@ -0,0 +1,14 @@ +// https://github.com/Modernizr/Modernizr/issues/572 +// http://jsfiddle.net/glsee/JRmdq/8/ +Modernizr.addTest('cssvminunit', function(){ + var bool; + Modernizr.testStyles("#modernizr { width: 50vmin; }", function(elem, rule) { + var one_vw = window.innerWidth/100, + one_vh = window.innerHeight/100, + compWidth = parseInt((window.getComputedStyle ? + getComputedStyle(elem, null) : + elem.currentStyle)['width'],10); + bool = ( parseInt(Math.min(one_vw, one_vh)*50,10) == compWidth ); + }); + return bool; +}); |