Created
November 21, 2012 06:05
-
-
Save matori/4123325 to your computer and use it in GitHub Desktop.
[Modernizr] CSS transforms-style: preserve-3d;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Modernizr.addTest('csstransformspreserve3d', function () { | |
var prop, | |
val, | |
cssText, | |
ret; | |
prop = 'transform-style'; | |
if ('webkitTransformStyle' in document.documentElement.style) { | |
prop = '-webkit-' + prop; | |
} | |
val = 'preserve-3d'; | |
cssText = '#modernizr { ' + prop + ': ' + val + '; }'; | |
Modernizr.testStyles(cssText, function (el, rule) { | |
ret = window.getComputedStyle ? getComputedStyle(el, null).getPropertyValue(prop) : ''; | |
}); | |
return (ret === val); | |
}); | |
var test = Modernizr.csstransformspreserve3d; | |
console.log(test); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works on Chrome 29/IE10. Thanks!