Problem with vendor prefix inserted *after* standard syntax
See original GitHub issueGood morning,
I’m using autoprefixer 6.6.1 and I noticed a problem with the order of a CSS selector it produces.
In my Sass file, if I write:
.some-selector {
transition: color .15s, transform .5s;
}
Autoprefixer generates the following code:
.some-selector {
-webkit-transition: color .15s, -webkit-transform .5s;
transition: color .15s, -webkit-transform .5s;
transition: color .15s, transform .5s;
transition: color .15s, transform .5s, -webkit-transform .5s;
}
The last line (transition: color .15s, transform .5s, -webkit-transform .5s;
) contains a vendor prefix but since it comes last, it has priority over the previous line (transition: color .15s, transform .5s;
) which contains no vendor prefix.
As a result, the transition does not work on Chrome 55.0.2883.95 (64-bit) nor on Firefox 50.1.0.
How would it be possible to invert both lines please? I’m stuck. Thanks for your help!
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
How To Deal With Vendor Prefixes - CSS-Tricks
There are plenty of different ways to deal with vendor prefixes in CSS as part of your workflow. It depends on if you...
Read more >CSS vendor prefixes considered harmful - QuirksBlog
It's time to abolish all vendor prefixes. They've become solutions for which there is no problem, and they are actively harming web standards....
Read more >Why use specific vendor prefixes instead of one representing ...
The problem with WebKit prefixes simply stems from a widespread abuse of prefixes by both vendors and authors (mostly with authors choosing to...
Read more >Vendor Prefixes Are Hurting the Web - Henri Sivonen
TL;DR: I think vendor prefixes are hurting the Web. They are hurting Web authors. They are hurting users of browsers. They are hurting ......
Read more >Vendor prefixes are not developer-friendly - Paul Irish
While plenty of implementation bugs were fixed, the developer would never have updated their syntax and would have complete browser support. box ...
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 found problem.
transition-delay
is hard coded to 2 values only, so it stop working on 3 values intransition: color .15s, transform .5s, -webkit-transform .5s
.You can fix it by:
Unfortunately, there is no way to prefix it in other way. Browsers that you support requires
-webkit-transform
. And the only way to fix it is this big preset and different values length (we thought a lot about some other solution).Technically, Autoprefixer even warn you about this risk. But you should use gulp/webpack Aurtoprefixer to see warnings. Maybe we need ask @chriscoyier to add some UI and show warnings from PostCSS plugins.
Great, thank you so much for your help @ai!
I still cannot figure why I cannot compile the line you suggested:
Anyway, if I ditch the Sass
for
loop and write it by hand, it works. Another mystery yet to solve!All credits go to @Twikito! 😃 As for the BEM syntax, yes you’re absolutely right. However the original CodePen is a quick demo he wrote, so that may be the reason why the code is not as compact as it could be.
Thank you again so much for your help! \m/