Repository navigation
feat(core): rtlStyles.centerInline helper + lint detection for the centering idiom - #4613
Merged
Merged
Conversation
…e centering idiom Adds a direction-symmetric inline-centering helper (physical left:50% + translateX(-50%)) with the single sanctioned no-physical-properties suppression, and teaches the rule to detect the left:'50%'+translate centering idiom and point at the helper instead of logicalizing it.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
July 31, 2026 22:17
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
nynexman4464
marked this pull request as ready for review
July 31, 2026 23:24
nynexman4464
requested review from
cixzhang,
ejhammond and
imdreamrunner
as code owners
July 31, 2026 23:24
nynexman4464
enabled auto-merge (squash)
July 31, 2026 23:26
This was referenced Aug 5, 2026
This branch was successfully deployed
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.
What
Add a shared
rtlStyles.centerInline(blockOffset)helper for horizontally centering an absolutely-positioned, auto-width element on the inline axis (optionally with a block-axis offset folded into the same transform), and teach@astryx/no-physical-propertiesto detect theleft: '50%'+ centeringtranslateidiom.Why
Centering with physical
left: 50%+translateX(-50%)is direction-symmetric — both reference the same physical edge, so it centers identically in LTR and RTL. A logicalinsetInlineStart: 50%anchor would flip in RTL while the physical translate does not, shifting the element off-center by its own width. This is the one case where physicalleftis correct, so the single sanctioned suppression lives in the helper. The lint now points offenders at the helper instead of wrongly suggesting a logical rename.Verification
tsc(core) cleanrtlStyles.tsBottom of a 3-PR stack (helper → migration → error-gate).
@nynexman4464