blob: 28f8ca21b33097df0ee975cbd2caf36f7ba9c746 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// https://github.com/Modernizr/Modernizr/issues/572
// http://jsfiddle.net/FWeinb/etnYC/
Modernizr.addTest('cssvwunit', function(){
var bool;
Modernizr.testStyles("#modernizr { width: 50vw; }", function(elem, rule) {
var width = parseInt(window.innerWidth/2,10),
compStyle = parseInt((window.getComputedStyle ?
getComputedStyle(elem, null) :
elem.currentStyle)["width"],10);
bool= (compStyle == width);
});
return bool;
});
|