Skip to content

Instantly share code, notes, and snippets.

@willread
Last active August 29, 2015 14:24
Show Gist options
  • Save willread/6ebdb478aef35508c246 to your computer and use it in GitHub Desktop.
Save willread/6ebdb478aef35508c246 to your computer and use it in GitHub Desktop.
Gulp task to scale all css pixel values down by 10%
var replace = require('gulp-replace');
gulp.task('resizeCSS', function() {
gulp.src(['clients/unata/styles/*.styl', 'clients/unata/styles/**/*.styl'])
.pipe(replace(/([0-9]+\.?[0-9]*)px/g, function(match, size) {
if(size > 0){
size = Math.max(1, Math.round(size * 0.9));
}
return size + 'px';
}))
.pipe(gulp.dest('clients/unata/styles'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment