This repository was archived by the owner on Feb 24, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add node-sass-asset-functions to resolve font-url issue. Refs #8
- Loading branch information
1 parent
28b3dd8
commit b8cdfec
Showing
7 changed files
with
131 additions
and
82 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var fs = require('fs'); | ||
var sass = require('node-sass'); | ||
var assetFunctions = require('node-sass-asset-functions'); | ||
|
||
function sassRender(infile,outfile) { | ||
sass.render({ | ||
file: infile, | ||
functions: assetFunctions({ | ||
http_fonts_path: '../../source/fonts' | ||
}) | ||
}, function(err, result) { | ||
if (err) console.error(err) | ||
else { | ||
fs.writeFile(outfile,result.css.toString(),'utf8'); | ||
} | ||
}); | ||
} | ||
|
||
sassRender('./source/stylesheets/screen.css.scss','./pub/css/screen.css'); | ||
sassRender('./source/stylesheets/print.css.scss','./pub/css/print.css'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.