Skip to content

Commit 96bd495

Browse files
author
Jérôme Brunel
authored
Merge pull request #65 from evandiamond/feature/scssFile
Added option for scssFile: true
2 parents 9755f69 + 60ef3d8 commit 96bd495

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ See [webfonts-generator#csstemplate](https://github.com/sunflowerdeath/webfonts-
117117
If true the font is encoded in base64 and embedded inside the `@font-face` declaration, otherwise font files are written to disk.
118118
Default: `false`
119119

120+
##### `scssFile`, Boolean
121+
122+
If true, the build process will export a .scss file in the same path as the .css file.
123+
Default: `false`
124+
120125
##### `hashLength`, Number
121126

122127
Optional. The length of hash in `fileName`.

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ module.exports = function (content) {
9898
baseSelector: fontConfig.baseSelector || '.icon',
9999
classPrefix: 'classPrefix' in fontConfig ? fontConfig.classPrefix : 'icon-'
100100
},
101+
scssFile: fontConfig.scssFile || false,
101102
dest: fontConfig.dest || '',
102103
html: fontConfig.html || false,
103104
htmlDest: fontConfig.htmlDest || undefined,
@@ -143,6 +144,11 @@ module.exports = function (content) {
143144
generatorOptions.dest = path.resolve(this.context, fontConfig.dest);
144145
}
145146

147+
// Spit out SCSS file to same path as CSS file to easily use mixins (scssFile must be true)
148+
if (fontConfig.scssFile === true) {
149+
generatorOptions.cssDest = path.resolve(this.context, fontConfig.dest, fontConfig.fontName + '.scss');
150+
}
151+
146152
// svgicons2svgfont stuff
147153
var keys = [
148154
'fixedWidth',

0 commit comments

Comments
 (0)