fix(rtl): use logical spacing/text-align classes instead of physical ones - #550
Open
swe-sanad wants to merge 1 commit into
Open
fix(rtl): use logical spacing/text-align classes instead of physical ones#550swe-sanad wants to merge 1 commit into
swe-sanad wants to merge 1 commit into
Conversation
…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.
Contributor
Confidence Score: 5/5The 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Hardcoded physical spacing/text-align classes (
ml-/mr-,pl-/pr-,text-left/text-right) don't mirror whendir="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/right→text-start/end. Behavior-preserving for LTR (these resolve to the same physical side when direction isltr) and correct underdir="rtl".Deliberately does not touch
left-/right-(positioning),border-l/r(side border width), or transforms (translate-xetc.) — 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-xare never touched), then spot-checked by hand. Zero remainingml-/mr-/pl-/pr-/text-left/text-rightinstances after conversion.