bryles
v0.0.2
Published
Inline css compiled from stylus (incl. browserify transform)
Downloads
3
Readme
Bryles
A highly opinionated package for compiling css (from Stylus) in node and inlined using browserify.
Apart from Stylus also Autoprefixer
and clean-css (with the
compress
flag) is applied.
var bryles = require('bryles');
var insertCss = require('insert-css');
bryles.compile(__dirname + '/index.styl', function( err, css ){
if (err)
return console.error(err);
// browser context?
if (typeof window !== 'undefined')
insertCss(css);
});
An optional argument before the callback is allowed for configuration. So far
the only option is compress
which will minify your styles using clean-
css.
bryles.compile(__dirname + '/index.styl', {
compress: true,
}, cb);
var bryles = require('bryles');
var browserify = require('browserify');
browserify()
.transform(bryles, {
compress: true,
})
.add('index.js')
.bundle()
.pipe(fs.createWriteStream('bundle.js'));
If you need anything else (sass support?) or more flexibility, send a pull request.
You might be interested in Brarkup.