Skip to content

Commit

Permalink
Added option for scssFile: true
Browse files Browse the repository at this point in the history
Option will spit out .scss file in same location as .css file.
Allows for ability to use mixins without much extra work.
  • Loading branch information
Evan committed Jan 31, 2019
1 parent 9755f69 commit 956e3f6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -212,4 +218,4 @@ module.exports = function (content) {

cb(null, res.generateCss(urls));
});
};
};

0 comments on commit 956e3f6

Please sign in to comment.