postcss-wprtl

1.2.1 • Public • Published

PostCSS-WPRTL

PostCSS plugin for WordPress theme developers to transform style.css into rtl.css. Powered by rtlcss.

By default, WordPress themes load both rtl.css and style.css stylesheets. Therefore rtl.css should only include flipped CSS rules, nothing else.

Features

  • Removes all CSS declarations that are unimportant for RTL
  • Generates reset values for margins, paddings and borders
  • Flips CSS rules from LTR to RTL by using rtlcss

Install

Install the npm package:

$ npm install postcss-wprtl --save-dev

Usage

postcss([ require('postcss-wprtl') ])

See PostCSS docs to setup with Gulp, Grunt or Webpack.

Examples

/* style.css */
.site-branding {
    float: left;
    margin-right: 2em;
    padding: 0;
    max-width: 100%;
}
/* rtl.css */
.site-branding {
    float: right;
    margin-right: 0;
    margin-left: 2em;
}

Package Sidebar

Install

npm i postcss-wprtl

Weekly Downloads

14

Version

1.2.1

License

MIT

Last publish

Collaborators

  • themezee