nDmitry / grunt-postcss

Apply several post-processors to your CSS using PostCSS.
MIT License
419 stars 57 forks source link

Strange output with autoprefixer #80

Closed roubaobaozi closed 8 years ago

roubaobaozi commented 8 years ago

Hi,

I have autoprefixer running on the following code:

transition: transform .3s, color .3s;

It is outputting:

transition: color .3s, -webkit-transform .3s;
transition: transform .3s, color .3s;
transition: transform .3s, color .3s, -webkit-transform .3s;

But shouldn't it be outputting this?

-webkit-transition: -webkit-transform .3s, color .3s;
transition: transform .3s, color .3s;

My postcss settings are:

postcss: {
            options: {
              map: {
                  inline: false, // save all sourcemaps as separate files...
                  annotation: '../css/' // ...to the specified directory
              },

              processors: [
                require('autoprefixer')({browsers: 'last 2 versions'}), // add vendor prefixes
              ]
            },
            dist: {
              src: '../css/*.css'
            }
        }

I have no idea if I'm doing anything wrong, if it's outputting incorrectly, or if it's actually correct.

Thanks

nDmitry commented 8 years ago

transition without prefixes is supported in all modern browsers while transform isn't yet: http://caniuse.com/#feat=transforms2d

You're using the default browsers list (>1%, last 2 versions), so iOS Safari and Android 4.4.4 are included. Check out live Autoprefixer tool here https://autoprefixer.github.io/ if you want to experiment with browsers list.

And you can't just put all prefixed properties with prefixed values in one line as some browsers versions support unprefixed transition, but not transform. Hope it helps.

roubaobaozi commented 8 years ago

Oh, so it IS meant to be like that, okay great, thanks :)

I was staring at it thinking something must be wrong ...