npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

postcss-tailwind-rtl-rotate

v0.0.0

Published

PostCSS plugin that handles Tailwind rotate clases for RTL mode

Readme

postcss-tailwind-rtl-rotate

npm version Build Status Coverage Status

A PostCSS plugin that automatically handles Tailwind CSS rotate classes for RTL (Right-to-Left) layouts by negating rotation values in RTL mode.

What it does

This plugin transforms Tailwind CSS rotate utilities to work correctly in both LTR and RTL layouts. When you use rotate classes like rotate-45, the plugin automatically creates RTL-specific versions that negate the rotation values, ensuring your rotated elements appear correctly in both text directions.

Installation

npm install postcss-tailwind-rtl-rotate --save-dev

Usage

Add the plugin to your PostCSS configuration:

// postcss.config.js
module.exports = {
  plugins: [
    require("postcss-tailwind-rtl-rotate"),
    // other plugins
  ],
};

Or use it with other build tools:

// webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "postcss-loader",
            options: {
              plugins: [require("postcss-tailwind-rtl-rotate")],
            },
          },
        ],
      },
    ],
  },
};

How it works

The plugin scans your CSS for rules containing rotate- in their selectors and --tw-rotate custom properties. For each matching rule, it:

  1. Creates an RTL-specific version with [dir="rtl"] selector and negated rotation values
  2. Creates an LTR-specific version with [dir="ltr"] selector and original rotation values
  3. Removes the --tw-rotate declaration from the original rule (or removes the entire rule if it becomes empty)

Examples

Input CSS

.rotate-45 {
  --tw-rotate: 45deg;
}

.hover\:rotate-90:hover {
  --tw-rotate: 90deg;
}

.rotate-180 {
  --tw-rotate: 180deg;
  color: red;
}

Output CSS

[dir="rtl"] .rotate-45 {
  --tw-rotate: -45deg;
}
[dir="ltr"] .rotate-45 {
  --tw-rotate: 45deg;
}

[dir="rtl"] .hover\:rotate-90:hover {
  --tw-rotate: -90deg;
}
[dir="ltr"] .hover\:rotate-90:hover {
  --tw-rotate: 90deg;
}

[dir="rtl"] .rotate-180 {
  --tw-rotate: -180deg;
}
[dir="ltr"] .rotate-180 {
  --tw-rotate: 180deg;
}
.rotate-180 {
  color: red;
}

Supported rotation units

The plugin supports all CSS rotation units:

  • Degrees: 45deg, -90deg, 180deg
  • Turns: 0.25turn, 0.5turn, 1turn
  • Radians: 1.57rad, 3.14rad
  • Numeric values: 45, -90, 180

Browser support

This plugin works with any browser that supports:

  • CSS Custom Properties (CSS Variables)
  • The dir attribute

Testing

Run the test suite:

npm test

The plugin includes comprehensive tests covering:

  • Different rotation units
  • Positive and negative values
  • Complex selectors
  • Rules with additional CSS properties
  • Edge cases and error handling

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT © Asef

Changelog

0.0.0

  • Initial release
  • Support for all CSS rotation units
  • Automatic RTL/LTR rule generation
  • Comprehensive test coverage