-
Notifications
You must be signed in to change notification settings - Fork 3
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
RTL Direction of the document leaks into the card #94
Comments
Thanks for mentioning this because it would not have occurred to me. So, because one is naturally reading RTL, then they would expect to see the icons on the right? For RTL languages, why not align the whole card to the right side as well? Also, how do you deal with mixed RTL/LTR? |
This problem is a little more complex than you might think. Ideally the direction of the elements of the card should depend on the primary language of the elements on the card. However, some phrases used in the card such as To deal with content that has a mix of LTR and RTL text, we use Unicode's BIDI standards which stands for bi-directional. There are many old and modern CSS properties and HTML attributes/elements to handle different situations. |
By the way, if we were to use CSS Grid, we can get rid of a lot of floats in the style. |
For future reference, the URI-M in the picture above is https://web.archive.org/web/20180621231600/https://www.urduweb.org/mehfil/ Is this correct @ibnesayeed ? |
Yes! |
While they do not have an RTL layout for the card for RTL languages, they keep their card consistent, irrespective of the direction of the container page. They are achieving it by dynamically replacing the |
When the card is embedded into an RTL page, some components of the card such as favicons are placed at the unintended side as shown in the following screenshots.
In an LTR page
In an RTL page
Ideally, we should identify the text direction of the memento and render the card in that direction, independent on the direction of the host document. If doing that sounds difficult initially, we should at least isolate the direction property of the card by explicitly declaring it to be
ltr
. This can be done in two ways, either by adding adir="ltr"
attribute to the top-most element of the card or by assigning adirection: ltr;
CSS property to it.The text was updated successfully, but these errors were encountered: