Skip to content

Instantly share code, notes, and snippets.

@rob-bar
Last active December 16, 2015 10:19
Show Gist options
  • Save rob-bar/5419093 to your computer and use it in GitHub Desktop.
Save rob-bar/5419093 to your computer and use it in GitHub Desktop.
Modernizr csstransformpreserve3D test
# 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