2021-01-25 12:28:12 +01:00
|
|
|
const gulp = require('gulp');
|
2016-05-16 15:45:14 +02:00
|
|
|
var sass = require('gulp-sass');
|
2021-01-25 12:28:12 +01:00
|
|
|
var postcss = require('gulp-postcss');
|
|
|
|
var CombineMQ = require('postcss-combine-media-query');
|
2018-10-31 15:24:17 +01:00
|
|
|
var autoprefixer = require('autoprefixer');
|
2021-01-25 12:28:12 +01:00
|
|
|
var CSSnano = require('cssnano');
|
2018-10-31 15:24:17 +01:00
|
|
|
|
2021-01-25 12:28:12 +01:00
|
|
|
gulp.task('css:full', () => {
|
|
|
|
return gulp.src('sass/knacss.scss')
|
|
|
|
.pipe(sass(
|
|
|
|
{
|
|
|
|
outputStyle: 'expanded'
|
|
|
|
}))
|
|
|
|
.pipe(
|
|
|
|
postcss([
|
|
|
|
autoprefixer, // ajoute les préfixes vendeurs
|
|
|
|
]))
|
|
|
|
.pipe(gulp.dest('css/knacss-full'));
|
2015-04-14 10:04:17 +02:00
|
|
|
});
|
|
|
|
|
2021-01-25 12:28:12 +01:00
|
|
|
gulp.task('css:mini', () => {
|
|
|
|
return gulp.src('sass/knacss.scss')
|
|
|
|
.pipe(sass(
|
|
|
|
{
|
|
|
|
outputStyle: 'compact'
|
|
|
|
}))
|
|
|
|
.pipe(
|
|
|
|
postcss([
|
|
|
|
CombineMQ, // rassemble les Media Queries (parfait pour les classes utilitaires)
|
|
|
|
autoprefixer, // ajoute les préfixes vendeurs
|
|
|
|
CSSnano // minification
|
|
|
|
]))
|
|
|
|
.pipe(gulp.dest('css/knacss-mini'));
|
2015-12-24 09:04:43 +01:00
|
|
|
});
|
|
|
|
|
2021-01-25 12:28:12 +01:00
|
|
|
gulp.task('css:grillade', () => {
|
|
|
|
return gulp.src('sass/utils/grillade.scss')
|
|
|
|
.pipe(sass(
|
|
|
|
{
|
|
|
|
outputStyle: 'compact'
|
|
|
|
}))
|
|
|
|
.pipe(
|
|
|
|
postcss([
|
|
|
|
CombineMQ, // rassemble les Media Queries (parfait pour les classes utilitaires)
|
|
|
|
autoprefixer, // ajoute les préfixes vendeurs
|
|
|
|
CSSnano // minification
|
|
|
|
]))
|
|
|
|
.pipe(gulp.dest('css/grillade'));
|
2017-08-28 12:22:44 +02:00
|
|
|
});
|
|
|
|
|
2021-01-25 12:28:12 +01:00
|
|
|
// Tâche BUILD : tapez "gulp" ou "gulp build"
|
|
|
|
gulp.task('build', gulp.series('css:full', 'css:mini', 'css:grillade'));
|
2015-04-14 10:04:17 +02:00
|
|
|
|
2019-08-12 16:48:08 +02:00
|
|
|
// Tâche par défaut
|
2021-01-25 12:28:12 +01:00
|
|
|
gulp.task('default', gulp.series('build'));
|