Project

General

Profile

Actions

Feature #43506

closed

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

Added by Go MAEDA 22 days ago. Updated 22 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
UI
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

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
Actions #1

Updated by Go MAEDA 22 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from Candidate for next major release to 7.0.0
  • Resolution set to Fixed

Committed the patch in r24151.

Actions

Also available in: Atom PDF