JSFiddle - React, Tailwind, and code Playground
by glsee
HTML
<script src="http://modernizr.com/downloads/modernizr-2.5.3.js"></script>
JavaScript
Modernizr.addTest('cssvhunit', function() {
var bool;
Modernizr.testStyles("#modernizr { height: 50vh; }", function(elem, rule) {
var height = parseInt(window.innerHeight/2,10),
compStyle = parseInt((window.getComputedStyle ?
getComputedStyle(elem, null) :
elem.currentStyle)["height"],10);
bool= !!(compStyle == height);
});
return bool;
});
console.log(Modernizr.cssvhunit);