Skip to content
This repository was archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
Add node-sass-asset-functions to resolve font-url issue. Refs #8
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRalphson committed Aug 4, 2017
1 parent 28b3dd8 commit b8cdfec
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 82 deletions.
3 changes: 0 additions & 3 deletions buildstyle

This file was deleted.

20 changes: 20 additions & 0 deletions buildstyle.js
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');
175 changes: 104 additions & 71 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
},
"devDependencies": {
"ejs-lint": "^0.2.0",
"node-sass": "^3.14.0-0"
"node-sass": "^4.5.3",
"node-sass-asset-functions": "^0.1.0"
}
}
Loading

0 comments on commit b8cdfec

Please sign in to comment.