Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stylis-plugin-rtl

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylis-plugin-rtl

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

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
208K
decreased by-1.65%
Maintainers
1
Weekly downloads
 
Created

What is stylis-plugin-rtl?

The stylis-plugin-rtl npm package is a plugin for Stylis, a lightweight CSS preprocessor. This plugin automatically converts CSS styles to support right-to-left (RTL) languages, making it easier to develop applications that need to support RTL layouts.

What are stylis-plugin-rtl's main functionalities?

Automatic RTL Conversion

This feature automatically converts left-to-right (LTR) CSS properties to their right-to-left (RTL) equivalents. For example, 'margin-left' becomes 'margin-right' and 'padding-right' becomes 'padding-left'.

const stylis = require('stylis');
const rtl = require('stylis-plugin-rtl');
stylis.use(rtl);

const css = `.example { margin-left: 10px; padding-right: 20px; }`;
const rtlCss = stylis('', css);
console.log(rtlCss); // Outputs: .example { margin-right: 10px; padding-left: 20px; }`

Integration with Stylis

This feature allows seamless integration with Stylis, enabling automatic RTL conversion during the CSS preprocessing stage. This ensures that all styles are correctly converted without additional manual intervention.

const stylis = require('stylis');
const rtl = require('stylis-plugin-rtl');
stylis.use(rtl);

const css = `.example { float: left; text-align: right; }`;
const rtlCss = stylis('', css);
console.log(rtlCss); // Outputs: .example { float: right; text-align: left; }`

Other packages similar to stylis-plugin-rtl

Keywords

FAQs

Package last updated on 30 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc