Skip to content

Instantly share code, notes, and snippets.

@askd
Last active May 19, 2017 08:01
Show Gist options
  • Save askd/6a3cf9db98cb1e09127857c8872b54cb to your computer and use it in GitHub Desktop.
Save askd/6a3cf9db98cb1e09127857c8872b54cb to your computer and use it in GitHub Desktop.
Test transform-style: preserve-3d support
function testPreserve3DSupport() {
const element = document.createElement('p');
document.body.insertBefore(element, null);
const propName = 'transform-style';
element.style[propName] = 'preserve-3d';
const propValue = window.getComputedStyle(element, null).getPropertyValue(propName);
document.body.removeChild(element);
return (propValue === 'preserve-3d');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment