Last active
December 16, 2015 10:19
-
-
Save rob-bar/5419093 to your computer and use it in GitHub Desktop.
Modernizr csstransformpreserve3D test
This file contains hidden or 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.csstransformspreserve3d | |
Modernizr.addTest 'csstransformspreserve3d', () -> | |
val = '' | |
cssText = '' | |
ret = '' | |
prop = 'transform-style' | |
if 'webkitTransformStyle' of document.documentElement.style | |
prop = '-webkit-' + prop | |
val = 'preserve-3d' | |
cssText = "#modernizr { #{prop} : #{val}; }" | |
Modernizr.testStyles cssText, (el, rule) -> | |
comp = window.getComputedStyle | |
if comp isnt null and comp isnt undefined | |
ret = comp(el, null).getPropertyValue(prop) | |
return | |
else | |
ret = '' | |
return | |
return ret is val |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment