Skip to content

fix(editor): use logical CSS properties so the editor UI mirrors in RTL - #3807

Open
alon710 wants to merge 1 commit into
resend:canaryfrom
alon710:editor-logical-css
Open

alon710 wants to merge 1 commit into
resend:canaryfrom
alon710:editor-logical-css

Conversation

@alon710

@alon710 alon710 commented Oct 26, 2026

Copy link
Copy Markdown

Intent

Fixes #3806

Fix: the editor UI doesn't mirror in right-to-left pages. When @react-email/editor is embedded in a dir="rtl" app (Hebrew, Arabic), the bubble menu separators sit on the wrong side of each group, menu items and slash-command items stay left-aligned, the link form opens from the left edge, the inspector's unit and color triggers get their gap on the wrong side, and the empty-paragraph placeholder floats to the left while the caret sits on the right.

Changes

Every physical-direction rule in the editor UI stylesheets now uses its logical equivalent:

File Before After
ui/bubble-menu/bubble-menu.css border-left on [data-re-bubble-menu-group] border-inline-start
ui/bubble-menu/bubble-menu.css padding-right: 0 on the last group padding-inline-end: 0
ui/bubble-menu/bubble-menu.css text-align: left on [data-re-node-selector-item] text-align: start
ui/bubble-menu/bubble-menu.css left: 0 on [data-re-link-selector-form] inset-inline-start: 0
ui/slash-command/slash-command.css text-align: left on [data-re-slash-command-item] text-align: start
ui/inspector/inspector.css margin-left on the unit and color triggers margin-inline-start
ui/inspector/inspector.css border-left between toggle items border-inline-start
ui/themes/default.css float: left on the placeholders float: inline-start

In left-to-right layouts each logical property resolves to the same value as before, so nothing changes there.

Not changed, on purpose

  • Anything that reaches the exported email HTML. Serializer output, extension renderers and email theming stay physical, because Outlook and Gmail don't support logical properties.
  • Content alignment. .tiptap [alignment="left"|"right"], the align-left and align-right buttons, and the 'left' default alignment are explicit user choices that the email output depends on.
  • The inspector tooltip. It centers itself with left: 50% plus translateX(-50%), which works the same in both directions.
  • Floating-ui placements such as bottom-start. Floating-ui already resolves these against the element's computed direction.

Testing

  • pnpm vitest run --project unit in packages/editor: 54 files, 521 tests passed.
  • tsc --noEmit and biome check on the changed files are clean.
  • tsdown build passes. The logical properties survive the postcss-import inlining into dist/ui/themes/default.css.
  • Changeset added for @react-email/editor (patch).

馃 Generated with Claude Code

The bubble menu, slash command menu, inspector and placeholder styles used
physical properties (border-left, padding-right, margin-left, left: 0,
text-align: left, float: left). In a right-to-left page these put
separators, spacing, menu text and placeholders on the wrong side.

They now use the logical equivalents (border-inline-start,
padding-inline-end, margin-inline-start, inset-inline-start,
text-align: start, float: inline-start), which resolve to the same values
in left-to-right layouts.

Styles that end up in the exported email HTML are left physical on
purpose, since email clients don't support logical properties.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

@alon710 is attempting to deploy a commit to the resend Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

馃 Changeset detected

Latest commit: c4884ee

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@react-email/editor Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Oct 26, 2026

This branch has not been deployed

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

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor UI doesn't mirror in right-to-left pages

1 participant