Page MenuHomePhabricator

[WIP] Replace `mw-content-ltr` and `mw-content-rtl` classes with a general class and a `dir` attribute selector`
Closed, DuplicatePublic

Description

From an CSS architecture point of view, current

<div id="#mw-content-text" class="mw-content-DIR" dir="DIR" lang="LANG-TAG">

is inflexible, unnecessary descriptive and confusing.

CodeSearch shows, that the mw-content-DIR classes are not used widely, while using the id selector is adding additional complexity to overrides. Minerva is using the id selector in article.less extensively.

Proposal
  • Add mw-content class; TODO: this seems to add more confusion to the already three content classes
  • Replace #mw-content-text LESS selectors by .mw-content; TODO: See above
  • Replace .mw-content-DIR LESS selectors with .mw-content[dir=DIR] selectors

Update & TODO

While writing the first attempt for this task, I reminded myself to address this differently and more general. This could come in handy with Desktop improvements and even more so with simplification of the skinning process.

From Minerva DOM structure

main#content.mw-body
  .pre-content
  #bodyContent.content
  #mw-content-text.mw-content-DIR[dir=DIR]
    #mainpage
    .printfooter
  .post-content

Event Timeline

Restricted Application added subscribers: Masumrezarock100, Aklapper. · View Herald Transcript

Original introduction of mw-content-DIR and ticket T8100: Allow different directionality (rtl/ltr) for user interface and wiki content

i'm not entirely sure why this got introduced like this specifically.. I do know there are some DOM differences between the skin that are important here... Possibly it is also because some wikis have rtl content inside of ltr content... and multilingual situations.. Not entirely sure.