dir="auto" uses first strongIt is a valuable browser-native baseline. An English product name at the start of an otherwise RTL sentence can still select LTR.Choose policy by available authority.
User locale, field schema, or explicit message direction should outrank inference.
Publish first-strong, word/character dominance, neutral fallback, and tie rules.
One document can contain both directions.
inherited baseoverride if neededbdi / isolatestable layoutDo not apply one global flip.
Paragraphs, headings, lists, quotes, and tables need structural ownership.
Code, terminal, diff, JSON, hashes, paths, and URLs require stable isolation.
Textarea, backdrop, mirror, wrap, height, selection, and IME share one direction state.
Presentation must not rewrite content.
Use semantic HTML markup. Invisible controls alter copy/paste, search, diffs, model replay, and security review.
Sixteen release gates.
- 01Every surface has an owner.
- 02First-strong limits are tested.
- 03Heuristic is versioned.
- 04Authored direction wins.
- 05Blocks can override root.
- 06Inline tokens are isolated.
- 07Code layout stays stable.
- 08Composer layers agree.
Primary evidence.
- Mixed-script report #696
- RTL proposal #4009
- rc.2 Markdown root
- Unicode Bidirectional Algorithm
- W3C bidi markup examples
Make every direction decision observable.
The complete guide covers message and block policy, inline isolation, code safety, composer geometry, security, cross-browser fixtures, and all sixteen gates.
Read the complete RTL contract