# stylis-plugin-rtl

> Fork of stylis-rtl, uses cssjanus under the hood to flip style orientations for RTL

Latest version **2.1.1** (published 2021-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install stylis-plugin-rtl
pnpm add stylis-plugin-rtl
yarn add stylis-plugin-rtl
bun add stylis-plugin-rtl
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-10-19 |
| First published | 2019-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 37 |
| Author | Jop de Klein |
| Maintainers | probablyup |
| Keywords | rtl, bidi, stylis, emotion, emotion-js, css, preprocessor, styled-components |

## Links

- npm: https://www.npmjs.com/package/stylis-plugin-rtl
- Repository: https://github.com/styled-components/stylis-plugin-rtl
- Homepage: https://github.com/styled-components/stylis-plugin-rtl#readme
- Issues: https://github.com/styled-components/stylis-plugin-rtl/issues
- npm.io page: https://npm.io/package/stylis-plugin-rtl

## Dependencies (1)

- [cssjanus](https://npm.io/package/cssjanus.md) ^2.0.1

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 2.1.1 (latest) — 2021-10-19
- 2.0.0-test.3 (test) — 2020-08-30
- 2.1.0 — 2021-05-05
- 2.0.2 — 2021-03-19
- 2.0.1 — 2020-12-01
- 2.0.0 — 2020-08-30
- 2.0.0-test.2 — 2020-08-30
- 2.0.0-test.1 — 2020-08-30
- 2.0.0-test.0 — 2020-08-30
- 1.1.0 — 2020-08-28
- 1.0.0 — 2019-12-29

## README

# stylis-plugin-rtl

Stylis RTL plugin based on CSSJanus

> NOTE! Use v1 of this plugin for styled-components v5, NOT v2 (v2 is for libraries that have upgraded to stylis v4, which s-c has not yet. At the moment only emotion 11 is updated.)

## Installation

### v1

```shell
yarn add stylis-plugin-rtl@^1
```

### v2

```shell
yarn add stylis-plugin-rtl stylis
```

## Usage with styled-components v5+

```javascript
import styled, { StyleSheetManager } from "styled-components";
import rtlPlugin from "stylis-plugin-rtl";

const Box = styled.div`
  padding-left: 10px;
`;

function MakeItRTL() {
  return (
    <StyleSheetManager stylisPlugins={[rtlPlugin]}>
      <Box>My padding will be on the right!</Box>
    </StyleSheetManager>
  );
}
```

#### NOTE: Preventing flipping

Because minification removes all comments from your CSS before it passes to `<StyleSheetManager>`, `/* @noflip */` comment won't work. 
You will have to either:
- add an exclamation mark at the beginning of the comment, like this  `/*! @noflip */`, to prevent it from being removed
- disable minification entirely by setting `minify` to `false` in `.babelrc` (see [styled-components documentation](https://styled-components.com/docs/tooling#minification)).

<small>This is a fork of `stylis-rtl` for use with styled-components v5+</small>

---
_Source: https://npm.io/package/stylis-plugin-rtl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
