Skip to content

fix(menu): use text-align: start so items follow RTL - #4048

Open
raydapay wants to merge 1 commit into
jgthms:mainfrom
raydapay:fix/menu-rtl-text-align
Open

fix(menu): use text-align: start so items follow RTL#4048
raydapay wants to merge 1 commit into
jgthms:mainfrom
raydapay:fix/menu-rtl-text-align

Conversation

@raydapay

Copy link
Copy Markdown

Fixes #4029.

The menu is already mostly migrated to logical properties — the nested list uses border-inline-start / padding-inline-start. The one physical holdout is item alignment in sass/components/menu.scss:

.menu-list .menu-item,
a,
button { text-align: left; }

This forces left alignment regardless of writing direction. Switching to text-align: start:

  • resolves to left in LTR, so it's identical there (non-breaking);
  • resolves to right under dir="rtl", so items align with the writing direction automatically — matching the rest of the component.

Verified on a .menu in both directions: items hug the left in LTR and the right in RTL, with nothing else changed.


While here, I noticed .field-label (sass/form/tools.scss) and table th (sass/elements/table.scss) have the same physical text-align — happy to fix those too if you'd like, here or in a follow-up.

The menu list item alignment was hard-coded to text-align: left, the last
physical holdout in a component otherwise migrated to logical properties
(the nested list already uses border-inline-start / padding-inline-start).
text-align: start is identical to left in LTR and follows dir=rtl.

Fixes jgthms#4029
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.

Menu component doesn't support RTL

1 participant