Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Provide an alternative to right-to-left #25584

Merged
merged 1 commit into from Apr 2, 2021

Conversation

dariusk
Copy link
Contributor

@dariusk dariusk commented Apr 2, 2021

Updating the right-to-left language guide to reflect that adding dir="rtl" to the <body> element is only one solution for configuring RTL for native components. You can also wrap them in a lower-level div, as long as it is the parent of all your UI components. This is helpful because <body> is often defined as a template outside the scope of a React app, whereas a <div> that wraps the entire application can be easily controlled from an application component like a language switching toggle.

Adding `dir="rtl"` to the `<body>` element is only one solution for configuring RTL for native components. You can also wrap them in a lower-level div, as long as it is the parent of all your UI components. This is helpful because `<body>` is often defined as a template outside the scope of a React app, whereas a `<div>` that wraps the entire application can be easily controlled from an application component like a language switching toggle.
@mui-pr-bot
Copy link

mui-pr-bot commented Apr 2, 2021

No bundle size changes

Generated by 🚫 dangerJS against 470cf1f

@oliviertassinari oliviertassinari changed the title Updating right-to-left language guide to be more specific about dir HTML attribute [docs] Update right-to-left language guide to be more specific about dir HTML attribute Apr 2, 2021
@oliviertassinari oliviertassinari changed the title [docs] Update right-to-left language guide to be more specific about dir HTML attribute [docs] Provide an alternative to right-to-left Apr 2, 2021
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Apr 2, 2021
@oliviertassinari oliviertassinari merged commit 3f9b3d1 into mui:next Apr 2, 2021
@oliviertassinari
Copy link
Member

@dariusk It's a great first pull request on Material-UI 👌🏻. Thank you for working on it!

@oliviertassinari
Copy link
Member

Note that it doesn't work with portals, and that the specs recommend to put it in the <html> element: #32194 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants