bryles

0.0.2 • Public • Published

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.

Dependencies (8)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i bryles

    Weekly Downloads

    2

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • thomas-jensen