@sector-labs/postcss-to-rtl

0.1.1 • Public • Published

PostCSS to Rtl Build Status

PostCSS plugin to convert (left to right) CSS to RTL.

Enables projects that serve their CSS inlined in a style tag in the documents to build smaller, separate RTL and LTR CSS files for the LTR and RTL pages.

Use this instead of postcss-inline-rtl or other postcss pluging that produce a big CSS files containing rules for both directions.

To get even smaller files, use css-byebye to further strip the rules with the wrong direction from the resulting CSS.

Recommendation

Always have a dir="ltr" or dir="rtl" in your HTML tag.

Examples

/*  Normal code */
.class {
  color: red;
}

/*  => no change */
.class{
  border-left: 10px;
  color: red;
}

/*  Converts to: */
.class {
  border-right: 10px
  color: red;
}

Usage

postcss([ require('postcss-to-rtl') ])

Cred

+1 for rtlcss, postcss-inline-rtl as this wouldn't exist without these!

See PostCSS docs for examples for your environment.

Package Sidebar

Install

npm i @sector-labs/postcss-to-rtl

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

7.86 kB

Total Files

6

Last publish

Collaborators

  • mihaitoader
  • liviusl
  • adeelzahir
  • cristi.ingineru
  • cipix2000
  • alexandrukis
  • sectorlabs
  • photonios
  • ovidiu_s
  • alexsfirlea
  • _alexandrukis
  • dolha.dan