-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Add RTL Support #4886
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
Add RTL Support #4886
Conversation
Awesome! direction: ltr to the site settings sections in Here's the config for the demo link mentioned in the PR description. |
For me, it is the same. But I am not introducing css changes. It only makes the body page "RTL". I guess still we need the body direction in "rtl". |
Correct. I added the body direction to CSS, but I think adding the |
Agreed. you can copy the documentation part from mine. I will close my PR. |
Thanks! Cherry picked your doc change! 🙌🏻 |
Looks decent. I have one minor concern: For the configuration key, why did you choose |
Thanks for the feedback @iBug, that totally makes sense! Also I thought maybe it's better to inject a |
Aaaaah, there's actually an exact example in the scss docs: // It can also be used to style the outer selector in a certain context, such
// as a body set to use a right-to-left language.
[dir=rtl] & {
margin-left: 0;
margin-right: 10px;
} |
b5988ca
to
e79646e
Compare
Signed-off-by: Hamed Faramarzi <[email protected]>
50bd4ea
to
9ebd124
Compare
Seems sufficiently good for now so I've merged it. If you have any further improvements feel free to open another PR. One potential improvement I can think of is replacing all affected margins and paddings with |
I've pushed a few extra commits and I wonder if you'd like to help test it (e.g. |
Sorry for late reply. |
Hi, thanks for your work. It would be great to dynamically adjust the direction of the paragraph based on the used language. Just like the way that GitHub handles RTL languages in rendered markdown views: همانطور که مشاهده میکنید، جهت این پاراگراف از راست به چپ است. |
@srezasm If you use Kramdown's syntax for adding HTML attributes, you'll automatically have RTL for only specified paragraphs:
|
@iBug Can it be automated by the language that paragraph is started with? |
@srezasm Not sure. Maybe you can go with |
@iBug It works with |
@srezasm You can probably just add one |
@iBug Didn't work, do you know how to add it to all individual text placeholder tags? |
Signed-off-by: Hamed Faramarzi <[email protected]> Co-authored-by: Hamed Faramarzi <[email protected]> Co-authored-by: iBug <[email protected]>
This is an enhancement or feature.
Summary
As you might know, some writing systems are written and read from right to left (mainly Persian, Arabic & Hebrew). These types of writings need extra formatting for web.
In this PR I added the support for RTL direction with the minimum changes in the code by only adding an extra css file, & not changing the html structures and leaving zero side effect for the original left to right view.
These changes are just meant to be proof of concept and are not final changes. I was not sure if RTL support is a concern for the project or not, but if it is, then I'll be more than happy to make them ready for a final review.
Context
RTL support was previously mentioned in #3903 but the suggested changes where affecting the original LTR direction.
Live Demo
Here's a live demo of the RTL support.