Skip to content

Commit

Permalink
Merge pull request #65 from evandiamond/feature/scssFile
Browse files Browse the repository at this point in the history
Added option for scssFile: true
  • Loading branch information
Jérôme Brunel authored Jan 31, 2019
2 parents 9755f69 + 60ef3d8 commit 96bd495
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ See [webfonts-generator#csstemplate](https://github.com/sunflowerdeath/webfonts-
If true the font is encoded in base64 and embedded inside the `@font-face` declaration, otherwise font files are written to disk.
Default: `false`

##### `scssFile`, Boolean

If true, the build process will export a .scss file in the same path as the .css file.
Default: `false`

##### `hashLength`, Number

Optional. The length of hash in `fileName`.
Expand Down
6 changes: 6 additions & 0 deletions 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

0 comments on commit 96bd495

Please sign in to comment.