Actions
Feature #43506
openDeclare text direction on HTML element for better RTL/LTR styling support
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
No data to display
Actions