From 956e3f65ea7c1da514dfeecb84a2b32a97324827 Mon Sep 17 00:00:00 2001 From: Evan <> Date: Wed, 30 Jan 2019 19:10:30 -0500 Subject: [PATCH] Added option for scssFile: true Option will spit out .scss file in same location as .css file. Allows for ability to use mixins without much extra work. --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 06bcd94..9c8356b 100644 --- a/index.js +++ b/index.js @@ -98,6 +98,7 @@ module.exports = function (content) { baseSelector: fontConfig.baseSelector || '.icon', classPrefix: 'classPrefix' in fontConfig ? fontConfig.classPrefix : 'icon-' }, + scssFile: fontConfig.scssFile || false, dest: fontConfig.dest || '', html: fontConfig.html || false, htmlDest: fontConfig.htmlDest || undefined, @@ -143,6 +144,11 @@ module.exports = function (content) { generatorOptions.dest = path.resolve(this.context, fontConfig.dest); } + // Spit out SCSS file to same path as CSS file to easily use mixins (scssFile must be true) + if (fontConfig.scssFile === true) { + generatorOptions.cssDest = path.resolve(this.context, fontConfig.dest, fontConfig.fontName + '.scss') + } + // svgicons2svgfont stuff var keys = [ 'fixedWidth', @@ -212,4 +218,4 @@ module.exports = function (content) { cb(null, res.generateCss(urls)); }); -}; +}; \ No newline at end of file