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

tailwindcss-rtl

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tailwindcss-rtl

tailwindcss-rtl

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
decreased by-4.5%
Maintainers
1
Weekly downloads
 
Created
Source

tailwindcss-rtl


Total Downloads Latest Release

Introduction

Internationalization in semitic languages needs more than just translating texts, you would also need to mirror the layout horizontally. This can be done by adding dir="rtl" the the layout body tag, but this is propably not be enough and you will need to create a diffirect style for RTL.

With tailwindcss-rtl plugin you will be able to support both RTL and LTR in the same style.

A full example can be seen here: workaction-rtl

This plugin was inspired by Elad Shechter's medium article tackling the same issue with Sass.

Installation

Install tailwindcss-rtl package:

# Yarn
yarn add tailwindcss-rtl --dev

# NPM
npm install tailwindcss-rtl --save-dev

Require tailwindcss-rtl in tailwind.config.js file:

plugins: [
  require('tailwindcss-rtl'),
],

Utilities

*tailwindcss-rtl adds the start and end notations as substitue for left and right.

Padding

ClassDescriptionLTR PropertyRTL Property
ps-[X]padding on start directionpadding-left: [x]rempedding-right: [x]rem
pe-[X]padding on end directionpadding-right: [x]rempedding-left: [x]rem

Padding docs

Margin

ClassDescriptionLTR PropertyRTL Property
ms-[X]margin on start directionmargin-left: [x]remmargin-right: [x]rem
me-[X]margin on end directionmargin-right: [x]remmargin-left: [x]rem

Margin docs

Float

ClassDescriptionLTR PropertyRTL Property
float-startfloat to start directionfloat: leftfloat: right
float-endfloat to end directionfloat: rightfloat: left

Float docs

Right/Left

ClassDescriptionLTR PropertyRTL Property
start-[X]float to start directionleft: [x]right: [x]
end-[X]float to end directionright: [x]left: [x]

Right/Left docs

Clear

ClassDescriptionLTR PropertyRTL Property
clear-startclear to start directionclear: leftclear: left
clear-endclear to end directionclear: rightclear: right

Clear docs

Border Radius

ClassLTR PropertyRTL Property
rounded-s-[X]border-top-left-radius: [x]
border-bottom-left-radius: [x]
border-top-right-radius: [x]
border-bottom-right-radius: [x]
rounded-e-[X]border-top-right-radius: [x]
border-bottom-right-radius: [x]
border-top-left-radius: [x]
border-bottom-left-radius: [x]
rounded-ts-[X]border-top-left-radius: [x]border-top-right-radius: [x]
rounded-te-[X]border-top-right-radius: [x]border-top-left-radius: [x]
rounded-bs-[X]border-bottom-right-radius: [x]border-top-right-radius: [x]
rounded-be-[X]border-bottom-left-radius: [x]border-top-left-radius: [x]

Border radius docs

Usage

Replace all padding, margins, floats and insets utilities with the corresponding utilities.

for example when you create an LTR layout and you would like to add left padding to an element you would normaly use pl-6, left is the start direction in LTR so you will replace it with ps-6.

Now add dir="rtl" or dir="ltr" attribute to your top level layout element:

<body dir="rtl">

Keywords

FAQs

Package last updated on 09 Apr 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