0

I use gulp to concatenate my css files into one. Some css files are needed to be changed before the concatenation e.g

mobile_home.css

.pagination-image-right {
    padding-left: 20px;
}

.pagination-image-left {
    padding-right: 20px;
}

I need to wrap it like this

@media (max-width: 1000px) and (min-aspect-ratio: 4/3) {
    .pagination-image-right {
        padding-left: 20px;
    }

    .pagination-image-left {
        padding-right: 20px;
    }
}

I created the task

gulp.task('styles', function() { 
  return gulp.src('mobile_home.css')
    .pipe(fs.readFile("mobile_home.css"), "utf-8", function(err, _data) {
    // Wrap here
}))
    .pipe(concat('./src/custom.css'))
    .pipe(cleanCSS())
    .pipe(gulp.dest('./'))
});

Is it possible to open, change, save files and how?

Many thanks.

dlx
  • 59
  • 7
  • 1
    I can't think of a way if there is no [plugins](http://gulpjs.com/plugins/) doing what you expect. – Elfayer Jul 28 '16 at 14:40
  • yep, the answer is in http://stackoverflow.com/questions/38374936/how-can-i-use-gulp-to-add-a-line-of-text-to-a-file – dlx Jul 29 '16 at 09:28

0 Answers0