Project

General

Profile

Actions

Feature #43506

open

Declare text direction on HTML element for better RTL/LTR styling support

Added by Go MAEDA about 12 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
UI
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

The attached patch sets the DIR attribute on the HTML element according to the current language direction.

For example:

  <html lang="en" dir="ltr">
  <html lang="fr" dir="ltr">
  <html lang="ar" dir="rtl">

This makes it easier for plugins and themes to write direction-aware CSS, such as:

  html[dir="ltr"] .admonition { border-left: 2px solid red; }
  html[dir="rtl"] .admonition { border-right: 2px splid red; }

The change is harmless. In RTL environments, rtl.css already sets html {direction: rtl;}, and browsers use the CSS direction property over the HTML dir attribute for layout. Therefore, adding dir to the HTML element does not change the visual appearance of existing pages, but simply exposes the direction as a reliable hook for additional CSS.


Files

html-dir-attr.patch (1.87 KB) html-dir-attr.patch Go MAEDA, 2025-11-20 10:18

No data to display

Actions

Also available in: Atom PDF