0.0.4 • Published 8 years ago

rtlcss-stylus v0.0.4

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

rtlcss-stylus

A simple Stylus middleware wrapper for the excellent rtlcss

npm tests

Installation

You can install through npm as such: npm install rtlcss-stylus

Usage

You can include rtlcss-stylus as a normal stylus plugin. Full example creating two different stylesheets (ltr and rtl) at every pass below:

    function compile(rtl, str, path) {

        var compile = stylus(
            str
        );

        if (rtl) compile = compile.use(rtlcss());

        return compile;

    }

    app.use(
        stylus.middleware(
            {
                src: path.join(__dirname, 'public'),
                dest: path.join(__dirname, 'public'),
                compile: compile.bind(this, false)
            }
        )
    );

    app.use(
        stylus.middleware(
            {
                src: path.join(__dirname, 'public'),
                dest: function(cssPath){

                    return path.join(__dirname, 'public',cssPath).replace('style.css', 'style-rtl.css');

                },
                compile: compile.bind(this, true)
            }
        )
    );

Currently only has a basic test which you can run via npm test.

In production I only tested it with inline rtlcss directives, i.e. without providing any special options via the middleware.

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago