Skip to content

carvinlo/gulp-import-css

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gulp-import-css Build Status

Import several css files into a single file, one by one, rebasing urls and inlining @import

Install

Install with npm.

npm install --save-dev gulp-import-css

Examples

Let's say you have assets/reset.css:

body {margin: 0}

assets/home.css:

@import url('reset.css');
/* Important: can't be @import 'reset.css' */
.home {font-size: 14px; }

After gulp you get dist/home.css:

body {
  margin: 0;
}

/* Important: can't be @import 'reset.css' */

.home {
  font-size: 14px;
}

This is the Gulpfile.js:

var gulp = require('gulp');
var importCss = require('gulp-import-css');

gulp.task('default', function () {
  gulp.src('assets/home.css')
    .pipe(importCss())
    .pipe(gulp.dest('dist/'));
});

Now, run the command gulp to get the combined css file.

License

MIT @ yuguo

About

Import several css files into a single file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 68.9%
  • CSS 31.1%