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

logical-properties

できること

このスキルは、left や right などの固定された方向を使うCSSを、読む方向に従う論理プロパティに変換します。複数の言語に対応したいサイトの開発者向けです。

使う場面

  • ✓右から左に読む言語のためにスタイルシートを準備してほしいとき。
  • ✓アラビア語、ヘブライ語、ペルシア語のサポートを追加し、レイアウトが崩れているとき。
  • ✓CSSを確認し、margin-left などを自動的に調整される形に置き換えたいとき。

スキルのリンク

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

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“アラビア語とヘブライ語の利用者にレイアウトが正しく表示されるよう、私のCSSを更新してもらえますか。”

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

仕組み

エージェントは、固定方向を使う余白や配置のルールを見つけ、インラインとブロックの論理的な同等のプロパティに置き換えます。その結果、テキストの方向が変わるとレイアウトも自動的に反転します。

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

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

Use CSS logical properties for i18n and RTL support

Physical CSS properties (margin-left, padding-right) are hardcoded to screen directions. In right-to-left languages (Arabic, Hebrew, Persian), what should be margin-left becomes margin-right. Without logical properties, supporting RTL requires maintaining duplicate stylesheets or complex overrides with [dir=rtl] selectors. Logical properties handle this automatically.

Quick Reference

  • Logical properties adapt to writing direction — margin-inline-start is left in LTR, right in RTL
  • Replace left/right margin and padding with inline-start/inline-end equivalents
  • Replace top/bottom with block-start/block-end equivalents
  • Logical properties also work correctly for vertical writing modes

Check

Find all uses of margin-left, margin-right, padding-left, padding-right, border-left, border-right, left, right (as positioning) that should be converted to logical equivalents.

Fix

Convert physical direction properties to their CSS logical property equivalents for RTL and internationalization support.

Explain

Explain CSS logical properties, the difference between physical and logical directions, and how they enable RTL language support.

Code Review

Review stylesheets, component styles, and responsive states related to Use CSS logical properties for i18n and RTL support. Flag exact selectors, declarations, or breakpoints that violate the rule in the rendered UI.


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

Rule page: https://frontendchecklist.io/rules/css/logical-properties

よくある質問

右から左の表示には、まだ別のスタイルが必要ですか?

通常は必要ありません。論理プロパティが方向を自動的に扱うため、重複したスタイルシートや追加の上書きは不要になることが多いです。

縦書きにも役立ちますか?

はい。このスキルは、論理プロパティが縦書きモードでも正しく動作すると説明しています。

変更後にレイアウトを確認すべきですか?

はい。このスキルは、さまざまな画面サイズと操作状態で、描画後のレイアウトを確認することを勧めています。

詳細

作者による元の説明

Use when reviewing stylesheets, component styles, and responsive behavior related to Use CSS logical properties for i18n and RTL support. Check the rendered layout across breakpoints and interaction states before proposing a fix.

repo: thedaviddias/Front-End-Checklist

人気

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

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

0

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

コメント

  • …

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

似ているスキル