Index of every page on this site: llms.txt
All skills
Run it yourself

Audit and convert CSS to use logical properties for RTL/bidirectional layout support. Use when the user asks to "make CSS RTL-safe", "use logical properties", "replace left/right with start/end", "audit CSS for i18n", "CSS internationalization", "fix CSS for RTL", "convert to logical properties", or when setting up any project that targets RTL locales (Arabic, Hebrew, Persian, Urdu). Works with Tailwind, CSS Modules, vanilla CSS, CSS-in-JS, and inline styles. Library-agnostic — works with any i18n setup.

Use this Skill: https://skilld.dev/gh/globalize-now/globalize-skills/css-i18n

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencestailwind.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Tailwind CSS Logical Properties

Tailwind provides logical property utilities that map to CSS logical properties. Convert physical utilities to their logical equivalents.


Class Conversion Table

Margin

Physical Logical CSS output
ml-{n} ms-{n} margin-inline-start
mr-{n} me-{n} margin-inline-end
mx-{n} mx-{n} No change needed — mx maps to margin-inline in Tailwind v3.3+

Padding

Physical Logical CSS output
pl-{n} ps-{n} padding-inline-start
pr-{n} pe-{n} padding-inline-end
px-{n} px-{n} No change needed — px maps to padding-inline in Tailwind v3.3+

Positioning

Physical Logical CSS output
left-{n} start-{n} inset-inline-start
right-{n} end-{n} inset-inline-end
inset-x-{n} inset-x-{n} No change needed — direction-neutral

Text alignment

Physical Logical
text-left text-start
text-right text-end
text-center text-center (no change)

Float

Physical Logical
float-left float-start
float-right float-end

Border

Physical Logical CSS output
border-l-{n} border-s-{n} border-inline-start-width
border-r-{n} border-e-{n} border-inline-end-width
border-l-{color} border-s-{color} border-inline-start-color
border-r-{color} border-e-{color} border-inline-end-color

Scroll margin and padding

Physical Logical
scroll-ml-{n} scroll-ms-{n}
scroll-mr-{n} scroll-me-{n}
scroll-pl-{n} scroll-ps-{n}
scroll-pr-{n} scroll-pe-{n}

Border radius

Physical Logical
rounded-tl-{n} rounded-ss-{n}
rounded-tr-{n} rounded-se-{n}
rounded-bl-{n} rounded-es-{n}
rounded-br-{n} rounded-ee-{n}
rounded-l-{n} rounded-s-{n}
rounded-r-{n} rounded-e-{n}

Utilities That Already Flip Automatically

These utilities use CSS properties that inherently respect dir="rtl". No conversion needed:

  • space-x-{n} — uses margin-inline-start under the hood (Tailwind v3.3+), auto-flips
  • divide-x-{n} — uses border-inline-start-width under the hood, auto-flips
  • Flexbox utilities (flex-row, justify-start, items-start, gap-{n}) — flex layout auto-flips with dir
  • Grid utilities (grid-cols-*, col-start-*) — grid layout auto-flips with dir
  • mx-{n} and px-{n} — symmetric, same value both sides

RTL/LTR Variant Modifiers

For edge cases where you need direction-specific styles that should NOT flip, Tailwind provides rtl: and ltr: variant modifiers:

<!-- Icon that should always point right in LTR, left in RTL -->
<span class="ltr:rotate-0 rtl:rotate-180">&#x2192;</span>

<!-- Different spacing for RTL only -->
<div class="ms-4 rtl:ms-8">

Use these sparingly — they indicate a pattern that logical properties can't handle, typically directional icons or asymmetric decorative layouts.

Enable RTL/LTR variants: These are enabled by default in Tailwind v3.3+. For older versions, add to tailwind.config.js:

module.exports = {
  // ... Tailwind v3.0-3.2 only
  plugins: [require('tailwindcss-rtl')], // or enable manually
}

Version Notes

  • Tailwind v3.3+: Logical property utilities (ms-*, me-*, ps-*, pe-*, start-*, end-*, float-start, text-start, rounded-s-*, rounded-e-*, border-s-*, border-e-*) are built-in. rtl: and ltr: variants are enabled by default.
  • Tailwind v3.0-3.2: Logical utilities not available natively. Use the tailwindcss-rtl plugin or write custom utilities. The rtl: / ltr: variants can be enabled via plugin.
  • Tailwind v4: Logical property utilities remain the same. CSS-first configuration doesn't change the utility names.

Scanning Strategy

When auditing a Tailwind project, search for these patterns in JSX/TSX files:

className patterns to find and replace:
  ml-     → ms-
  mr-     → me-
  pl-     → ps-
  pr-     → pe-
  left-   → start-
  right-  → end-
  text-left  → text-start
  text-right → text-end
  float-left  → float-start
  float-right → float-end
  border-l  → border-s
  border-r  → border-e
  rounded-l  → rounded-s
  rounded-r  → rounded-e
  rounded-tl → rounded-ss
  rounded-tr → rounded-se
  rounded-bl → rounded-es
  rounded-br → rounded-ee
  scroll-ml → scroll-ms
  scroll-mr → scroll-me
  scroll-pl → scroll-ps
  scroll-pr → scroll-pe

Be careful with search-and-replace: ml- also matches xml- in some contexts. Search within className or class attribute values only.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides a detailed workflow and reference guide for converting CSS to use logical properties, ensuring layouts adapt correctly to right-to-left (RTL) languages. It is purely instructional and contains no malicious code or security risks.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at 7ce78df. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 6 months ago

README badge

README badge for globalize-now/globalize-skills/css-i18n