Skip to content
RTL & Arabic Web

RTL is more than `direction: rtl`

One CSS declaration flips the text. It does not flip icons, carousels, progress rails, shadows, mixed Latin content or a layout built on left-to-right assumptions. A working checklist.

What actually breaks when you turn an interface right-to-left?

Mostafa Nouh — portraitMostafa NouhPublished 7 min read

Most Arabic interfaces that feel wrong are not wrong because of the Arabic. They are wrong because someone set the direction and assumed the job was done. The browser does mirror a great deal for you — and the set of things it does not mirror is exactly the set of things people notice.

What the browser mirrors for you

Set dir="rtl" and you get text flow, inline box order, and — if you wrote them — every logical CSS property. That last part is the one worth changing your habits for.

Instead ofWriteWhy
margin-leftmargin-inline-startFlips automatically with direction
padding-rightpadding-inline-endFlips automatically with direction
left / rightinset-inline-start / -endPositioning follows direction
text-align: lefttext-align: startAlignment follows direction
border-leftborder-inline-startRules and accents stay on the reading edge
Logical properties remove most of the manual mirroring work before it exists.

What it does not mirror — and what people notice

This is the real list. Every item here has to be decided by a person.

  • Directional icons. A back arrow, a “next” chevron, a send icon and an undo arrow all carry direction. A checkmark, a search glass and a trash can do not. Mirroring everything is as wrong as mirroring nothing.
  • Carousels and sliders. The track direction, the drag direction, the dot order and the “next” button all have to agree with each other and with the reading direction.
  • Progress rails and steppers. A checkout that progresses left-to-right in an Arabic layout reads as going backwards.
  • Shadows and light. A shadow offset to the right implies a light source. Mirroring the layout without the light makes the depth model incoherent.
  • Numbers and Latin fragments. Prices, model numbers, code, URLs and brand names stay left-to-right inside a right-to-left sentence. This is bidirectional text, and it is where most visible bugs live.
  • Tables. The first column moves to the right, but numeric columns often should stay aligned as numbers. That is a content decision, not a CSS one.
  • Scroll position. A horizontally scrollable container starts at the right in RTL, and browsers have historically disagreed about what scrollLeft means there.
  1. Mirrored by the browser

    Text flow, inline order, logical CSS properties

  2. Mirrored by you

    Directional icons, carousels, steppers, shadows, scroll origin

  3. Never mirrored

    Numbers, Latin fragments, code, logos, checkmarks

Three categories: mirrored by the browser, mirrored by you, and never mirrored.

The bidirectional text problem

An Arabic sentence containing a Latin product name, a version number or a URL is not one direction. The Unicode bidirectional algorithm resolves most of it correctly, and then fails visibly on the edges — usually around trailing punctuation, parentheses and mixed-script strings.

Bidi isolation
Wrapping a foreign-direction fragment so the surrounding text cannot be reordered by it. In HTML that is <bdi>; in CSS it is unicode-bidi: isolate. Use it for any value you did not author — user names, product titles, anything from a database.
html
<!-- The product name reorders the sentence around it -->
<p>وصل المنتج Galaxy S24 Ultra إلى المخزون.</p>

<!-- Isolated: the sentence stays stable whatever the value is -->
<p>وصل المنتج <bdi>Galaxy S24 Ultra</bdi> إلى المخزون.</p>
Use <bdi> for any interpolated value whose script you do not control.

The review checklist

Before an Arabic interface ships

  • Every back, next, send and undo icon points the correct way
  • Carousel track, drag direction and dot order agree
  • Steppers and progress rails advance toward the reading edge
  • Latin fragments inside Arabic sentences are isolated
  • Numeric table columns are aligned as numbers, not as text
  • Form labels, inputs and validation messages align to the same edge
  • Shadows and light direction are consistent with the mirrored layout
  • Horizontal scroll containers start at the correct edge
  • The layout was checked at 320, 375, 768 and 1440 — direction bugs are width-specific
  • Line height and font size suit Arabic, which sits taller than Latin at the same size

Sources

Contact

Have a site or store that needs to work better?

Tell me what is happening and on which page. A diagnosis is a useful first deliverable on its own.

I read every message myself and reply within one working day — usually with a question or two before anything else, because a scope worth quoting needs them answered.

Available for remote work aligned to EST hours
Mostafa Nouh — portrait

Mostafa Nouh

Full-Stack Developer & Product Builder

Location
Egypt · Remote