Created
July 3, 2019 19:31
-
-
Save carlosbensant/1aa1f4b82e77fba9bd215f9d4265c993 to your computer and use it in GitHub Desktop.
Iconfont Generator
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
#! /usr/bin/env node | |
var path = require('path') | |
var glob = require('glob') | |
var webfontsGenerator = require('webfonts-generator') | |
const THEME_DIR = 'public/wp-content/themes/soventix'; | |
glob(`${THEME_DIR}/assets/images/icons/*.svg`, {}, function (error, files) { | |
webfontsGenerator({ | |
files: files, | |
dest: `${THEME_DIR}/assets/iconfonts/`, | |
cssDest: `${THEME_DIR}/assets/scss/vendors/_iconfont.scss`, | |
fontName: 'iconfont', | |
cssFontsUrl: 'assets/iconfonts', | |
html: false, | |
types: ['woff', 'eot'], | |
order: ['woff', 'eot'], | |
templateOptions: { | |
classPrefix: 's-icon--', | |
baseSelector: '.s-icon' | |
} | |
}, function(error) { | |
if (error) | |
console.log('Failed generating the font!', error) | |
else | |
console.log('Font generated succesfully!') | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment