# postcss-transform-logical

> > Transform logical CSS properties using a `logical` keyword.

Latest version **1.2.0** (published 2024-05-06) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install postcss-transform-logical
pnpm add postcss-transform-logical
yarn add postcss-transform-logical
bun add postcss-transform-logical
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2024-05-06 |
| First published | 2023-04-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 1 |
| Author | Larry Davis |
| Maintainers | castastrophe |
| Keywords | transforms, css, custom, plugin, postcss, properties |

## Links

- npm: https://www.npmjs.com/package/postcss-transform-logical
- Repository: https://github.com/castastrophe/postcss-transform-logical
- Homepage: https://github.com/castastrophe/postcss-transform-logical#readme
- Issues: https://github.com/castastrophe/postcss-transform-logical/issues
- npm.io page: https://npm.io/package/postcss-transform-logical

## Dependencies (1)

- [postcss-values-parser](https://npm.io/package/postcss-values-parser.md) ^6.0.2

## 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

- 1.2.0 (latest) — 2024-05-06
- 1.1.0 — 2023-04-24

## README

# postcss-transform-logical

> Transform logical CSS properties using a `logical` keyword.

## Installation

Install this plugin for PostCSS using your preferred package manager:

```sh
yarn add -D postcss-transform-logical
```

## CLI Usage

Run PostCSS with this plugin using the following command:

```sh
postcss -u postcss-transform-logical -o dist/index.css src/index.css
```

Or add it to your PostCSS configuration:

```js
module.exports = {
  plugins: {
    'postcss-transform-logical': {},
  },
};
```

## Usage

This plugin transforms logical CSS properties using a `logical` keyword. To do this, prefix your desired transform with `logical` and follow it up with your desired transform function(s).

```css
.transform-it {
  transform: logical rotate(90deg) scale3d(2.5, 1.2, 0.3);
}
```

This will output the following:

```css
.transform-it,
[dir="ltr"] .transform-it,
.transform-it:dir(ltr) {
  transform: rotate(90deg) scale3d(2.5, 1.2, 0.3);
}

[dir="rtl"] .transform-it,
.transform-it:dir(rtl) {
  transform: matrix(-1, 0, 0, 1, 0, 0) rotate(90deg) scale3d(2.5, 1.2, 0.3);
}
```

For the left-to-right selector, note that the logical keyword was dropped and no replacement was inserted. This is because the logical keyword is the default for left-to-right layouts.

For the right-to-left selector, note that the logical keyword was replaced with a matrix transform. This transform adjusts the element's position to account for the right-to-left layout.

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