Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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