Skip to content

Instantly share code, notes, and snippets.

@matori
Created November 21, 2012 06:05
Show Gist options
  • Save matori/4123325 to your computer and use it in GitHub Desktop.
Save matori/4123325 to your computer and use it in GitHub Desktop.
[Modernizr] CSS transforms-style: preserve-3d;
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);
@Grsmto
Copy link

Grsmto commented Sep 28, 2013

Works on Chrome 29/IE10. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment