本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)75k · #2816

direction-attribute

できること

このスキルは、Webページが言語に合った正しい文字の方向を設定しているかを確認します。右から左への言語や、方向が混在するコンテンツのサイトを作る開発者向けです。

使う場面

  • ✓サイトに、アラビア語、ヘブライ語、ペルシア語、ウルドゥー語のコンテンツを追加するとき。
  • ✓利用者の名前やコメントに、左から右と右から左の文字が混在しているとき。
  • ✓右から左に読む利用者にとって、メニューやレイアウトが逆に見えるとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/direction-attribute/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/direction-attribute/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“アラビア語の読者にとって、私のサイトが正しく表示されるか確認してもらえますか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、ページ全体と、利用者のコメントのような方向が混在する部分のdir属性を確認します。必要に応じて、正しい値または分離のタグを追加することを提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Set text direction for RTL languages

Without proper dir attributes, RTL text displays incorrectly, UI elements appear backwards, and screen readers announce content in the wrong order.

Quick Reference

  • Set dir="rtl" on <html> for Arabic, Hebrew, Persian, Urdu
  • Use dir="auto" for user-generated content
  • Combine with CSS logical properties (inline-start, inline-end)
  • Test UI mirroring for navigation, icons, and layouts
  • Use bidi isolation such as <bdi> for inline mixed-direction user content

Check

Verify that this HTML document uses the appropriate dir attribute to indicate text direction for right-to-left languages like Arabic, Hebrew, or mixed content. Check user-generated inline text for dir="auto" or bidi isolation where names, handles, or snippets mix writing directions.

Fix

Add the dir attribute to the html element or specific elements with values 'ltr' (left-to-right), 'rtl' (right-to-left), or 'auto' for automatic detection. Use <bdi> or equivalent bidi isolation for mixed-direction inline content.

Explain

Explain how the dir attribute helps browsers and screen readers properly display and navigate text in different writing directions.

Code Review

Review templates, server-rendered HTML, and shared components that output markup related to Set text direction for RTL languages. Flag exact elements, attributes, and routes where the rendered HTML violates the rule. Inspect user-generated inline content, not only page-level locale wrappers.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/html/direction-attribute

よくある質問

dir属性は何をしますか?

文字が左から右に流れるか、右から左に流れるかを、ブラウザに伝えます。

bidiの分離とは何ですか?

別の文字の名前のように、方向の混在するテキストが周囲の文章を乱さないようにすることです。このスキルは、そのためにbdiタグを提案しています。

レイアウトの左右の反転も対象ですか?

ナビゲーション、アイコン、レイアウトが正しく反転するかを、テストすることを提案しています。

詳細

作者による元の説明

Use when reviewing templates, rendered HTML, or shared components related to Set text direction for RTL languages. Validate the final browser-facing markup, not just the source framework abstraction.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2816
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル