Redundant prefixes in @keyframes
See original GitHub issue- Save the following as
foo.css
:
@keyframes foo {
from { transform: scale(1) }
}
-
Run
postcss -u autoprefixer foo.css
-
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:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.