-
-
Save gitsebs/3c9560fe6ae9a0f31b14 to your computer and use it in GitHub Desktop.
postcss stack
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.task('styles:toolkit', ['lint-styles:toolkit'], function () { | |
var sourcemaps = require('gulp-sourcemaps'); | |
var prefix = require('gulp-autoprefixer'); | |
var postcss = require('gulp-postcss'); | |
var calc = require('postcss-calc'); | |
var colorFunction = require('postcss-color-function'); | |
var customMedia = require('postcss-custom-media'); | |
var customProperties = require('postcss-custom-properties'); | |
var fontVariant = require('postcss-font-variant'); | |
var lost = require('lost'); | |
var inline = require('postcss-import'); | |
var nested = require('postcss-nested'); | |
var simpleVars = require('postcss-simple-vars'); | |
var plumber = require('gulp-plumber'); | |
var logWarnings = require('postcss-log-warnings'); | |
var messages = require('postcss-messages'); | |
var processors = [ | |
inline(), | |
nested, | |
logWarnings({throwError: true}), | |
customProperties(), | |
calc(), | |
simpleVars(), | |
customMedia(), | |
lost(), | |
colorFunction(), | |
fontVariant() | |
]; | |
return gulp.src(config.src.styles.toolkit) | |
.pipe(sourcemaps.init()) | |
.pipe(plumber()) | |
.pipe(postcss(processors)) | |
.pipe(prefix()) | |
.pipe(sourcemaps.write()) | |
.pipe(gulpif(!config.dev, csso())) | |
.pipe(gulp.dest(config.dest + '/assets/toolkit/styles')) | |
.pipe(gulpif(config.dev, reload({stream:true}))) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment