question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3D transform functions should be stripped for IE9

See original GitHub issue

Per Can I Use, IE9 supports transforms with the -ms prefix, but not 3D transforms. IE10 supports 3D transforms, but does not use the prefix. Can a “hack” be added to strip all 3D functions (*Z() and *3d()) for the -ms prefixed rule?

Input:

transform:translateX(10px) translateZ(0);

Output:

-webkit-transform:translateX(10px) translateZ(0);
-ms-transform:translateX(10px) translateZ(0); /* invalid and ignored in IE9 */
transform:translateX(10px) translateZ(0);

Expected Output:

-webkit-transform:translateX(10px) translateZ(0);
-ms-transform:translateX(10px);
transform:translateX(10px) translateZ(0);

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
aicommented, Aug 15, 2017

@EasterPeanut

  1. Update your Autoprefixer. The latest version in 7.1.2.
  2. Check that you have IE 9 in your target browsers. For example, default browsers doesn’t contain IE 9 anymore. Try http://browserl.ist/
0reactions
EasterPeanutcommented, Aug 15, 2017

This is a great solution because translateZ will now be ignored in IE9. But when I try this as input (as fallback for IE9):

-ms-transform: translateX(10px);
transform: translateX(10px) translateZ(0);

I get this same output (-ms-transform property gets removed):

-webkit-transform: translateX(10px) translateZ(0);
transform: translateX(10px) translateZ(0);

When I try this in the autoprefixer playground, I do get the expected output though; including the -ms-transform. In my project (Webpack project) I am using autoprefixer 6.7.7. Any idea on what could be causing this?

Edit: never mind, already found out! It was the browser list in the package.json that had to be changed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS rotate property in IE - internet explorer - Stack Overflow
While it is possible to do transforms in IE8 (and IE6 and IE7) using filter matrix, it rotates around a different point to...
Read more >
perspective | CSS-Tricks
The perspective CSS property gives an element a 3D-space by affecting the distance between the Z plane and the user.
Read more >
Animation Using CSS Transforms - The Art of Web
How to scale, rotate, translate and transform elements using new CSS hover effects that work now in Safari, Webkit and Chrome.
Read more >
"form-" | Can I use... Support tables for HTML5, CSS3, etc
1 Internet Explorer 9 supports 2D but not 3D transforms. In version 9, mixing 2D and 3D transform functions invalidates the entire property....
Read more >
Creating Scroll-based Animations using jQuery and CSS3
We want to force hardware acceleration for speed, so a 3D transformation is a must (we will be using translate3d along with other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found