Skip to content

feat(core): rtlStyles.centerInline helper + lint detection for the centering idiom - #4613

Merged
nynexman4464 merged 2 commits into
mainfrom
nynexman4464/feat/rtl-center-inline-util
Jul 31, 2026
Merged

nynexman4464 merged 2 commits into
mainfrom
nynexman4464/feat/rtl-center-inline-util

Conversation

@nynexman4464

Copy link
Copy Markdown
Contributor

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-properties to detect the left: '50%' + centering translate idiom.

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 logical insetInlineStart: 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 physical left is 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) clean
  • lint-rule test suite green (44 cases)
  • eslint clean on rtlStyles.ts

Bottom of a 3-PR stack (helper → migration → error-gate).

@nynexman4464

…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.
@vercel

vercel Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Jul 31, 2026 11:24pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 31, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

github-actions Bot added a commit that referenced this pull request Jul 31, 2026
@nynexman4464
nynexman4464 marked this pull request as ready for review July 31, 2026 23:24
@nynexman4464
nynexman4464 enabled auto-merge (squash) July 31, 2026 23:26
@nynexman4464
nynexman4464 merged commit 3d3d463 into main Jul 31, 2026
21 checks passed
github-actions Bot added a commit that referenced this pull request Jul 31, 2026
@github-actions
github-actions Bot deleted the nynexman4464/feat/rtl-center-inline-util branch August 1, 2026 06:54

This branch was successfully deployed

1 active deployment
Preview — 3774265f Deployed Jul 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant