Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
var cleanCSS = require('gulp-clean-css');
var autoprefixer = require('gulp-autoprefixer');
var sass = require('gulp-sass');
gulp.task('css', function() {
.pipe(sass().on('error', sass.logError))
browsers: ['last 2 versions']
.pipe(cleanCSS({compatibility: 'ie8'}))
npm i -D gulp
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');
gulp.task('default', function() {
// place code for your default task here
var gulp = require('gulp');
gulp.task('default', function() {
// place code for your default task here
npm i -D gulp-sass gulp-autoprefixer gulp-clean-css
npm i -D gulp-image-optimization
npm install --global gulp-cli
npm install --save-dev package1 package2 package3
# alrenative shorthand
npm i -D package1 package2 package3
gulp.task('optimize-images', function(cb) {
gulp.src(['./*.png','./*.jpg','./*.gif','./*.jpeg', './images/**/*.*'])
mkdir example-gulp-theme && cd example-gulp-theme
touch header.php footer.php functions.php index.php style.css
npm init
html{background:#f90;transition:all .2s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
Theme Name: Gulp Test Theme
Description: A quick WordPress Gulp example theme
Author: Daniel Pataki
Author URI:
Version: 1.0.0
$bg: #ff9900;
html {
background: $bg;
transition: all 200ms linear;
gulp.task('watch-css', function () {'./*.scss', ['css']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.