Created
October 2, 2015 05:23
-
-
Save jdsimcoe/bcad2d41e57b22a74e3f to your computer and use it in GitHub Desktop.
My Sketch > SVG > Iconfont solution in Gulp.
This file contains 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
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