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.

Redundant prefixes in @keyframes

See original GitHub issue
  1. Save the following as foo.css:
@keyframes foo {
from { transform: scale(1) }
}
  1. Run postcss -u autoprefixer foo.css

  2. Outputs:

@-webkit-keyframes foo {
from { -webkit-transform: scale(1); transform: scale(1) }
}
@keyframes foo {
from { -webkit-transform: scale(1); transform: scale(1) }
}

Expected:

@-webkit-keyframes foo {
from { -webkit-transform: scale(1) }
}
@keyframes foo {
from { transform: scale(1) }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Kuneprocommented, May 5, 2016

I was bothered by this as well. Would it be possible to add to the README.md the compatibility table for browser that require @-webkit-keyframes { + prefixed properties } @-webkit-keyframes { + unprefixed properties } @keyframes { + prefixed properties } @keyframes { + unprefixed properties } In particular for the ones that don’t fit Kishan’s expected behaviour.

I honestly don’t know what browser versions do require all this extra code, but it might be easier to accept all this overhead if I knew why I’m letting this pass.

If you can do it, thanks.

0reactions
Kuneprocommented, May 5, 2016

I understand that you are afraid that the prefix gets removed from “transform” (f.e.) before/after @keyframe, and that if we don’t consider all 4 cases we might find ourselves in an unfortunate situation. Thanks for explaining.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do i add prefixes (transform) within ...
What you have certainly works, but it's unnecessary: ... WebKit versions that require @-webkit-keyframes do support unprefixed transforms.
Read more >
https://www.gsport88.com/assets/grand55/vendor/bou...
Adds keyframes blocks for supported prefixes, removing redundant prefixes in the block's content @mixin keyframes($name) { $original-prefix-for-webkit: ...
Read more >
Avoid Using Vendor Prefixes
Vendor prefixes don't have to be a necessary evil. See how the -prefix-free library can help you out.
Read more >
Animations and Movement in Sass
A little redundant, right? Not only do we define the same animation twice–one with the -webkit- prefix, and one without–but each keyframe in...
Read more >
Create more complex animations using CSS @keyframes
Instead, declare keyframes at the base level of the CSS file, using the ... While unnecessary, let's remove the transform property from the ......
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