Skip to content

Refine bidi styling guidance in qa-bidi-css-markup#849

Open
xfq wants to merge 2 commits into
gh-pagesfrom
xfq/issue-717
Open

Refine bidi styling guidance in qa-bidi-css-markup#849
xfq wants to merge 2 commits into
gh-pagesfrom
xfq/issue-717

Conversation

@xfq
Copy link
Copy Markdown
Member

@xfq xfq commented Mar 24, 2026

Fix #717.

I'll update the translation if this is approved.

Preview

@xfq xfq requested review from aphillips, jsahleen and r12a March 24, 2026 08:28
@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 24, 2026

Deploy Preview for i18n-drafts ready!

Name Link
🔨 Latest commit b5483cd
🔍 Latest deploy log https://app.netlify.com/projects/i18n-drafts/deploys/69cbcec7d31a3a0008c3bea0
😎 Deploy Preview https://deploy-preview-849--i18n-drafts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@r12a r12a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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().

@xfq
Copy link
Copy Markdown
Member Author

xfq commented Mar 31, 2026

Thanks for the review. I adjusted it in a different way, WDYT?

Copy link
Copy Markdown
Contributor

@aphillips aphillips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reformulate this section differently.


HTML provides comprehensive support for bidi using the dir attribute, as well as, sparingly, the bdi and bdo elements for special cases. Avoid tailoring the CSS properties direction and unicode-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.

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.

[questions/qa-bidi-css-markup] CSS vs. markup for bidi support

3 participants