Skip to content

fix(rtl): use logical spacing/text-align classes instead of physical ones - #550

Open
swe-sanad wants to merge 1 commit into
frappe:developfrom
SWE-Pioneers:fix/rtl-logical-properties
Open

fix(rtl): use logical spacing/text-align classes instead of physical ones#550
swe-sanad wants to merge 1 commit into
frappe:developfrom
SWE-Pioneers:fix/rtl-logical-properties

Conversation

@swe-sanad

Copy link
Copy Markdown

Problem

Hardcoded physical spacing/text-align classes (ml-/mr-, pl-/pr-, text-left/text-right) don't mirror when dir="rtl" is applied — margin/padding stays on the same physical side and text stays left/right-anchored regardless of direction.

Fix

Safe subset only: ml-/mr-ms-/me-, pl-/pr-ps-/pe-, text-left/righttext-start/end. Behavior-preserving for LTR (these resolve to the same physical side when direction is ltr) and correct under dir="rtl".

Deliberately does not touch left-/right- (positioning), border-l/r (side border width), or transforms (translate-x etc.) — those can sit right next to a converted class and interact with it in a way that needs a human to look, so a blind swap risks moving something to the wrong place.

How this was done

Converted mechanically with a small script that has its own 15+-case self-test (variant prefixes, negatives, arbitrary values, fractions all covered; verified px-/mx-/left-/right-/border-l-r/translate-x are never touched), then spot-checked by hand. Zero remaining ml-/mr-/pl-/pr-/text-left/text-right instances after conversion.

…ones

Safe subset only: ml-/mr- -> ms-/me-, pl-/pr- -> ps-/pe-, text-left/right ->
text-start/end. Behavior-preserving for LTR (these resolve to the same
physical side when direction is ltr) and correct under dir="rtl".

Deliberately does NOT touch left-/right- (positioning), border-l/r (side
border width), or transforms (translate-x etc.) -- those can sit right
next to a converted class and interact with it in a way that needs a
human to look, so a blind swap risks moving something to the wrong
place. Converted mechanically with a small script that has its own
15+-case self-test (ml/mr/pl/pr with variant prefixes, negatives,
arbitrary values, fractions; verified px-/mx-/left-/right-/border-l-r/
translate-x are never touched), then spot-checked by hand.
@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The Tailwind toolchain supports the introduced logical utilities, and the mechanical substitutions preserve existing LTR layout while enabling direction-aware spacing and alignment.

Reviews (1): Last reviewed commit: "fix(rtl): use logical spacing/text-align..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants