Usage Guide

Your guide on how to use and make the most out of RTLCSS

Time is Priceless, Caffeine is Not! Buy Me a Coffee ☕

Install

npm install -g rtlcss

§Basic usage

var rtlcss = require('rtlcss');
var result = rtlcss.process("body { direction:ltr; }");
//result == body { direction:rtl; }

§Advanced usage

// directly processes css and return a string containing the processed css
output = rtlcss.process(css [, options , plugins, hooks]);
output // processed CSS

// you can also group all configuration settings into a single object
result = rtlcss.configure(config).process(css, postcssOptions);
result.css // Processed CSS
result.map // Source map

Built on top of PostCSS, an awesome framework, providing you with the power of manipulating CSS via a JS API.

It can be combined with other processors, such as autoprefixer:

var result = postcss().use(rtlcss([options , plugins, hooks]))
                      .use(autoprefixer())
                      .process(css);

§CLI

Convert LTR CSS files to RTL using the command line. For usage and available options see Command Line Usage.

$ rtlcss input.css output.rtl.css

PREVNEXT