Last active
September 10, 2016 02:45
-
-
Save youthkee/b719b7034117c4369fab to your computer and use it in GitHub Desktop.
gulp-sassとgulp-postcssで快適コンパイル環境を構築 ref: http://qiita.com/youthkee/items/f456fb5730655cc8f9c2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm i gulp gulp-sass gulp-postcss postcss-cssnext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gulp scss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var postcss = require('gulp-postcss'); | |
var cssnext = require('postcss-cssnext'); | |
var PostcssSimpleVars = require('postcss-simple-vars'); | |
var PostcssNested = require('postcss-nested'); | |
var PostcssMixins = require('postcss-mixins'); | |
var PostcssImport = require('postcss-import'); | |
var paths = { | |
'src': 'src/', | |
'dist': 'dist/' | |
} | |
gulp.task('css', function() { | |
var processors = [ | |
cssnext(), | |
PostcssMixins(), | |
PostcssSimpleVars(), | |
PostcssNested(), | |
PostcssImport(), | |
]; | |
return gulp.src(paths.src + 'css/*.css') | |
.pipe(postcss(processors)) | |
.pipe(gulp.dest(paths.dist + 'css/')) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.header { | |
display: -webkit-box; | |
display: -ms-flexbox; | |
display: flex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.header { | |
display: flex; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.header { | |
display: flex; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment