Refine bidi styling guidance in qa-bidi-css-markup#849
Conversation
✅ Deploy Preview for i18n-drafts ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
r12a
left a comment
There was a problem hiding this comment.
This section is supposed to summarise the content below it. The statement about :dir() is not part of that content. We should either add a paragraph explaining what this does to the content below, or point to another article that explains how to use :dir().
|
Thanks for the review. I adjusted it in a different way, WDYT? |
aphillips
left a comment
There was a problem hiding this comment.
Suggesting a reformulation.
| <h2 id="quickanswer">Quick answer</h2> | ||
| <p>You should always use dedicated bidi markup to describe your content, where markup is available.</p> | ||
| <p>For HTML, the bidi markup is sufficient and no CSS bidi styling is needed. You should never apply CSS bidi styling to ordinary elements or attributes. This includes content delivered as XML using XHTML 1.x or polyglot markup.</p> | ||
| <p>For HTML, the bidi markup is sufficient, and you should not use CSS properties such as <code class="kw" translate="no">direction</code> or <code class="kw" translate="no">unicode-bidi</code> to control bidirectional behavior. CSS selectors such as <code class="kw" translate="no">:dir()</code> can still be useful for applying other styles that depend on the direction of text, but they do not control bidirectional behavior. That is a separate styling topic, and is not what the detailed discussion below is about.</p> |
There was a problem hiding this comment.
I would reformulate this section differently.
HTML provides comprehensive support for bidi using the
dirattribute, as well as, sparingly, thebdiandbdoelements for special cases. Avoid tailoring the CSS propertiesdirectionandunicode-bidi.CSS selectors such as
:dir()are useful for applying other styles that depend on the direction of text. These selectors do not control the text direction or alter how the bidi algorithm is applied to text. Instead they are used for altering presentational styles such as "left" vs. "right" position and sizing for thinks like borders, margins, alignment and the like.
Fix #717.
I'll update the translation if this is approved.
Preview