jgoux / generator-angulpify

Yeoman generator involving AngularJS, Gulp and Browserify
138 stars 21 forks source link

autoprefixer and SASS not working together #25

Closed rchampourlier closed 9 years ago

rchampourlier commented 9 years ago

Hi,

If I leave .pipe(autoprefixer('last 1 version')) in my style.js file, as soon as I try to add SCSS code like the nested &:hover below:

.label-clickable {
  cursor: pointer;

  &:hover {
    opacity: 0.9;
  }
}

the Gulp build fails with the following message:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Can't parse CSS: Unexpected { at line 13:11
  at Transform.stream._transform (/Users/rchampourlier/Dev/_personal/agile_flow/agile_dashboard/node_modules/gulp-autoprefixer/index.js:67:30)

Since I don't really what the autoprefixer is used for, I'm not sure what to do to help and fix this (understand make a PR if necessary). Could you guide me somehow? For now, I just commented it.

Thanks!

jgoux commented 9 years ago

Autoprefixer add the specific vendors related tags on a .css file. (-ms, -moz...etc) So you have to use it after the sass plugin. If it's not the solution, could you share your style.js ?

rchampourlier commented 9 years ago

Thanks for explaining! It seems I've somehow altered the order of the calls in the style.js file, everything seems correct in the generator... should have checked more before, but I had no idea it was a question of order!

Thanks!