Skip to content

Instantly share code, notes, and snippets.

@h4
Created October 30, 2014 15:41
Show Gist options
  • Save h4/3af1e6359ddf37e66c22 to your computer and use it in GitHub Desktop.
Save h4/3af1e6359ddf37e66c22 to your computer and use it in GitHub Desktop.
stylus base64
var stylus = require('stylus');
var fs = require('fs');
var str = fs.readFileSync('contacts/contacts.styl', {encoding: 'utf-8'});
console.log(__dirname);
stylus(str)
.set('filename', __dirname + '/contacts/contacts.styl')
.define('url', stylus.url()) // Включает base64
.render(function(err, css){
fs.writeFileSync('contacts/contacts.css', css);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment