:dir lacks wide support #256
Labels
doc:arab_ks
doc:arab_ug
doc:arfa
gap
The first comment in this issue is read by the gap-analysis document.
i:bidi_text
Bidirectional text
l:arb
Arabic
l:ks
Kashmiri
l:pes
Persian
l:ug
Uighur
l:ur
Urdu
p:basic
The gap-analysis priority is Basic.
s:arab
Arabic script (Used for arb + pes)
s:aran
Arabic nastaliq script style
x:adlm
x:alreq
x:arab-ks
x:arab-ug
x:blink
x:hebr
x:nkoo
This issue is applicable to all languages with RTL orthographies.
Style sheets need to add special rules for RTL styles if they are not supported by logical properties or values.
One approach is to create a second style sheet which, when pulled into an HTML page, overrides styles in the main style sheet with settings for RTL text. This approach is not ideal because it requires maintaining the styles in two separate locations, which can therefore get out of synch, and it requires explicit addition of a call to the second style sheet in every page that will support RTL text.
The
:dir()
pseudo-class avoids these issues by allowing the content author to include the RTL variations in the same style sheet as the others. However, it is not yet supported by all major browser engines.A workaround that precedes selectors with
:root[dir=rtl] selector_here
can help, but:dir()
is a better way forward. There also appear to be Shadow DOM implications if this is not supported.The Gap:
:dir
is not interoperably supported by all major browser engines.selectors-4 Describes the :dir() feature in CSS.
html5 Describes the :dir() feature in HTML.
Can I Use indicates that Gecko supports
:dir()
, but Blink, and Webkit do not.This was confirmed while trying to get this to work recently.
The functionality appears to be available in Blink, but behind a flag.
This simple test below checks whether :dir() causes styling to be changed. The test currently passes for Gecko, but not for Blink or WebKit browsers.
Priority:
This pseudo-class significantly improves the process of designing style sheets that can cater for both LTR and RTL pages. It is a valuable enabler for better internationalisation of the Web for the billion or so potential users of RTL scripts. This was therefore marked as Basic.
Tests & results:
interactive test, The browser supports :dir() selectors.
Action taken:
Blink • Webkit
Outcomes
WebKit now supports this selector, as well as Gecko.
The text was updated successfully, but these errors were encountered: