rtlcss-stylus

0.0.4 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i rtlcss-stylus

Weekly Downloads

2

Version

0.0.4

License

MIT

Last publish

Collaborators

  • shaharyakir