FormingPromptclaude-codecodexpublished fresh until

CSS: how should an agent fix Arabic RTL layouts?

Summary As of October 2026, set HTML direction, replace direction-dependent spacing with logical properties, and test Arabic alongside English; start with dir="rtl".

Not for Playwright catalogue and ICU checks; see localization-qa-agent-pseudo-missing-keys-icu-screenshots-rtl.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
APrompt · v1.0.0Arabic RTL component repair brief
How you use itYou paste it when you need it
What it can dowrites files; Shell and network instructions not verified; read the prompt text before running it.
What's inside
APrompt · v1.0.0Arabic RTL component repair brief
How you use it
You paste it when you need it
What it can do
writes files; Shell and network instructions not verified; read the prompt text before running it.
What's inside

What this thread does

Set lang="ar" dir="rtl" on Arabic documents, convert direction-dependent CSS to logical properties, and verify mixed text and interaction order in both directions.

Do first: Set lang="ar" dir="rtl" on the Arabic document root.

Steps

1. Capture the same page in English and Arabic. Give the agent a bounded component list and ask it to classify physical left/right rules as intentional or direction-dependent. 2. Set the document language and direction independently. Language does not imply direction. Use HTML dir for base direction, following W3C structural guidance. 3. Apply these mappings only where the physical side was the reading start/end. See MDN logical properties.

Existing intent in EnglishDirection-aware CSS
Leading outer spacingmargin-inline-start
Trailing inner spacingpadding-inline-end
Position at reading endinset-inline-end
Align to reading starttext-align: start

4. Keep DOM order meaningful for keyboard and assistive technology. Do not combine RTL with row-reverse merely to mirror the layout; inspect the resulting order before changing flex rules. 5. Isolate unknown inserted names with <bdi> or an appropriate dir="auto" boundary. For known Latin fragments use a direction boundary such as <span dir="ltr">ABC-42</span>. W3C inline guidance explains isolation; do not reverse strings. 6. Review navigation arrows individually. Mirror an arrow expressing reading/navigation direction when appropriate; do not mirror logos, photos, media controls or every icon mechanically.

Diagnostic: Arabic text is translated but the layout still reads left to right

Inspect the computed document direction first, then positioned children, physical offsets, portal-mounted menus and component overrides. A correctly translated label does not prove the surrounding layout supports RTL.

Acceptance checks for the agent

Create paired screenshots at the same viewport in English and Arabic. Assert the root language/direction, no unintended horizontal overflow, readable phone/order identifiers, non-overlapping labels, reachable focus targets and correct menu anchors. Cover dialogs, forms, tables, validation errors and long content, not just the home page. Use the existing browser test runner; keep screenshot baselines separate by locale. These are proposed checks, not reported passes.

Prompt for the agent

Fix only the selected components. Explain each left/right rule you keep or replace. Use semantic document direction and logical spacing, preserve DOM reading order, and show paired screenshots plus keyboard results. Mark font shaping and Arabic phrasing for human review.

Evidence — checked 2026-10-28

W3C Internationalization says “Never use CSS to apply the base direction.” Rupak Amin's RAITHub checklist proposes checking markup, overflow and menus separately. This is practitioner guidance, not an independent controlled trial. Evidence: none found for a public trial of this exact agent workflow.

Mistakes and limits

A pseudo-RTL view cannot prove Arabic shaping, punctuation, line breaks or screen-reader behavior. Logical properties respond to writing mode as well as direction; confirm the app's writing mode. Do not replace intentionally physical map or canvas coordinates. No browser/device matrix or Arabic accessibility review was run. This uses platform features rather than a version-specific CSS library and makes no release-version claim.

Started from a post by @W3C Internationalization, packaged by the editor. Original post

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# CSS: how should an agent fix Arabic RTL layouts?
Summary: As of October 2026, set HTML direction, replace direction-dependent spacing with logical properties, and test Arabic alongside English; start with `dir="rtl"`.

## Options
- A · Arabic RTL component repair brief · early, no verdict yet · writes files; Shell and network instructions not verified; read the prompt text before running it.
Copy for agent
get the whatworks thread arabic-rtl-css-agent-layout-qa and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread arabic-rtl-css-agent-layout-qa

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · Arabic RTL component repair brief

Original CC0-1.0 scoped repair prompt with paired-locale acceptance checks, derived from the thread. Writes one reusable brief; does not modify CSS or run a browser during installation.

Format
Prompt
Source
—
Pinned
v1.0.0 · sha256:834f7
Content hash
834f7ef1239a41e3
Audit
scan passed
Can do
writes files; Shell and network instructions not verified; read the prompt text before running it.
Works with
claude-code · codex
Check
Authored project file is present.; Exact authored file and evaluation checklist are intact; runtime/output quality requires the checklist.
Author
@WhatWorks
Kudos
0

This package has no public source link yet.

Are you @WhatWorks? Sign in with GitHub to claim it.
Ask your agent
show me the whatworks package ww-arabic-rtl-repair-brief before installing
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp