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 ☕

Hooks

Hooks provides you with the ability to manipulate the css before/after it is processed, The hooks object has two keys

PropertyTypeDescription
prefunctionThe function to be called before processing the CSS.
postfunctionThe function to be called after processing the CSS.

When a hook is called, it will be passed the Root node along with PostCSS instance.

ยงExample

var hooks = {
  post:function(root, postcss){
    root.insertBefore(root.nodes[0], postcss.comment({text: 'Generated by RTLCSS'}))
  }
}

rtlcss.process(css, options, plugins, hooks)

Input CSS:

body { direction:ltr;}

Output CSS:

/*Generated by RTLCSS*/
body { direction:rtl;}

PREVNEXT