Last active
January 4, 2019 14:22
-
-
Save matthewoestreich/bfc82ef5ab7406bc3b98422e51f63121 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const gulp = require('gulp'); | |
const sass = require('gulp-sass'); | |
const cssImport = require('gulp-cssimport'); | |
const cssBase64 = require('gulp-css-base64'); | |
const concat = require('gulp-concat'); | |
const task = gulp.task; | |
const src = gulp.src; | |
const dest = gulp.dest; | |
task('sass', function () { | |
return gulp.src('./material/scss/style.scss') | |
.pipe(sass()) | |
.on('error', function (err) { | |
console.log(err.toString()); | |
this.emit('end'); | |
}) | |
.pipe(cssImport()) | |
// ~ this rebases URLs incorrectly ~ // | |
//.pipe(concat('sass.css')) | |
.pipe(dest('./material/scss/sass.css')); | |
}); | |
task('import-sass-css', function () { | |
return src('./material/scss/style.scss') | |
.pipe(sass()) | |
.pipe(cssImport()) | |
.pipe(cssBase64({ | |
maxWeightResource: 1163840 | |
})) | |
.pipe(concat('stylesheet.css')) | |
.pipe(dest('./assets/gulped/final/')); | |
}); | |
task('mergecss', function () { | |
return src(['./material/css/animate.css', './material/css/form.css', './material/css/spinners.css', './material/css/style.css']) | |
.pipe(cssImport()) | |
.pipe(concat('stylesheet.css')) | |
.pipe(dest('./assets/gulped/')); | |
}); | |
task('icons/fa', function () { | |
return src('./material/css/icons/font-awesome/css/fontawesome-all.css') | |
.pipe(concat('fa.css')) | |
.pipe(cssBase64({ | |
maxWeightResource: 163840 | |
})) | |
.pipe(dest('./assets/gulped/icons/')); | |
}); | |
task('icons/linea', function () { | |
return src('./material/css/icons/linea-icons/linea.css') | |
.pipe(concat('linea.css')) | |
.pipe(cssBase64({ | |
maxWeightResource: 1163840 | |
})) | |
.pipe(dest('./assets/gulped/icons/')); | |
}); | |
task('icons/materialdesign', function () { | |
return src('./material/css/icons/material-design-iconic-font/css/*.css') | |
.pipe(concat('material-design.css')) | |
.pipe(cssBase64({ | |
maxWeightResource: 1163840 | |
})) | |
.pipe(dest('./assets/gulped/icons/')); | |
}); | |
task('icons/simpleline', function () { | |
return src('./material/css/icons/simple-line-icons/css/simple-line-icons.css') | |
.pipe(concat('simple-line.css')) | |
.pipe(cssBase64({ | |
maxWeightResource: 1163840 | |
})) | |
.pipe(dest('./assets/gulped/icons/')); | |
}); | |
task('icons/themify', function () { | |
return src('./material/css/icons/themify-icons/themify-icons.css') | |
.pipe(concat('themify.css')) | |
.pipe(cssBase64({ | |
maxWeightResource: 1163840 | |
})) | |
.pipe(dest('./assets/gulped/icons/')); | |
}); | |
task('icons/weather', function () { | |
return src(['./material/css/icons/weather-icons/css/weather-icons-wind.min.css', './material/css/icons/weather-icons/css/weather-icons.min.css']) | |
.pipe(concat('weather.css')) | |
.pipe(cssBase64({ | |
maxWeightResource: 1163840 | |
})) | |
.pipe(dest('./assets/gulped/icons/')); | |
}); | |
task('icons/concat', function () { | |
return src('./assets/gulped/icons/*.css') | |
.pipe(concat('icons.css')) | |
.pipe(dest('./assets/gulped/icons/final/')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment