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 ☕

Command Line Usage

Convert LTR CSS files to RTL using the command line.

You may need to use sudo (for OSX, *nix, BSD etc) or run your command shell as Administrator (for Windows).


Install RTLCSS’s command line interface (CLI) globally.

npm install -g rtlcss

§Command line usage

$ rtlcss [option option=parameter ...] [source] [destination]

If no destination is specified, output will written to {source name}.rtl.{source ext}


Convert input.css to output.rtl.css

$ rtlcss input.css output.rtl.css



Print a help message with available options and exits.

$ rtlcss -h
$ rtlcss --help


Print the current version number and exits.

$ rtlcss -v
$ rtlcss --version


Configuration can be set using one of the following methods:

  • Specify the configuration file manually via the --config flag.
  • Put your config into your projects package.json file under the rtlcssConfig property.
  • Use a special file .rtlcssrc or .rtlcssrc.json.
$ rtlcss -c
$ rtlcss --config <path>

Default .rtlcssrc

"options": {
"autoRename": false,
"autoRenameStrict": false,
"clean": true,
"greedy": false,
"processUrls": false,
"plugins": [ ],
"map": false

Source Map generation is disabled by default, you can enable it by setting map config to true. If you want more control over source map generation, visit postcss for more details on the available options.


Read input from stdin

$ rtlcss -
$ rtlcss --stdin

If no destination is specificed, the output will be written to stdout.


Used to indicate source/destination are directories - source directory will be processed recursively.

$ rtlcss -d
$ rtlcss --directory


Used with Directory option to set the output files extension. Default .rtl.css

$ rtlcss -e ".ext"
$ rtlcss --ext ".ext"


Silent mode, no warnings or errors will be printed.

$ rtlcss -s
$ rtlcss --silent