Skip to content

Instantly share code, notes, and snippets.

@jdsimcoe
Created October 2, 2015 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdsimcoe/bcad2d41e57b22a74e3f to your computer and use it in GitHub Desktop.
Save jdsimcoe/bcad2d41e57b22a74e3f to your computer and use it in GitHub Desktop.
My Sketch > SVG > Iconfont solution in Gulp.
var gulp = require("gulp");
var sketch = require('gulp-sketch');
var iconfont = require('gulp-iconfont');
var iconfontCss = require('gulp-iconfont-css');
// Iconfont
var fontName = 'circlecons';
var runTimestamp = Math.round(Date.now()/1000);
gulp.task('icons', function(){
return gulp.src('./icons/circlecons.sketch')
.pipe(sketch({
export: 'artboards',
formats: 'svg',
clean: true
}))
.pipe(gulp.dest('./src/img/icons/'))
.pipe(iconfontCss({
fontName: fontName,
path: './src/css/templates/_icons.scss',
targetPath: '../css/icons/_icons.scss',
fontPath: '/fonts/'
}))
.pipe(iconfont({
fontName: fontName,
appendUnicode: true,
fontHeight: 1000,
normalize: true,
formats: ['ttf', 'eot', 'woff', 'svg'],
timestamp: runTimestamp
}))
.pipe(gulp.dest('./src/fonts/'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment