nDmitry / grunt-autoprefixer

Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.
MIT License
795 stars 60 forks source link

Missing prefix #40

Closed nhall closed 10 years ago

nhall commented 10 years ago

I am using this grunt plugin and the following CSS remains unprefixed:

.csstransforms3d [data-off-canvas-state=invisible] .off-canvas {
    transform: translate3d(-110%, 0, 0);
}
.csstransforms3d [data-off-canvas-state=visible] .off-canvas {
    transform: translate3d(0, 0, 0);
}

Not the greatest selectors but I need to use the attribute selector to look at the data state. Modernizr adds the check for CSS transforms.

This is the task from my gruntfile.js:

autoprefixer: {
  options: {
    cascade: true,
    map: true
  },
  prefix_files: {
    expand: true,
    flatten: true,
    src: '<%= config.dist %>/*.css'
  }
},

Thanks

nDmitry commented 10 years ago

I think your prefixed files are saved to a project root due to this misconfiguration:

prefix_files: {
    expand: true,
    flatten: true,
    src: '<%= config.dist %>/*.css'
}

You should remove expand and flatten here.

nhall commented 10 years ago

I updated my gruntfile. Still doesn't prefix the transform. The CSS is wrapped in a media query @media (min-width: 37.5625em) { could that have anything to do with this?

nDmitry commented 10 years ago

I can't reproduce the issue with the exact same config and CSS, so the problem is somewhere in config file I believe.

nhall commented 10 years ago

Must be hanging on something else in my CSS. I pulled out just that code into individual CSS file and ran the same task. Prefixed it fine. Must be particular to something else in my project. Thanks.