Page MenuHomePhabricator

messagebox styles breaks indentation in some lists
Closed, DeclinedPublicBUG REPORT

Description

Class "messagebox" has a rule that any :only-child inside a messagebox should have margin 0.
This breaks indentation of some lists that contains sublists, since sublist ul or ol elements
often are only child of a li element.

This can also make list styles inconsistent when other wiki or html markup, like links, is
added to the lists.

Steps to Reproduce:
(This was tested in sandboxes of English Wikipedia and some other Wikimedia wikis)

  • Create a list with sublists (and no other wiki code or html) inside a div with class "messagebox":
<div class="messagebox">
*List item 1
**Sublist item 1
**#Ordered subsublist item 1
**#Ordered subsublist item 2
**Sublist item 2
***Unordered subsublist item 1
***Unordered subsublist item 2
</div>
  • For comparison create the same list in a div without class "messagebox":
<div>
*List item 1
**Sublist item 1
**#Ordered subsublist item 1
**#Ordered subsublist item 2
**Sublist item 2
***Unordered subsublist item 1
***Unordered subsublist item 2
</div>
  • Also look at a messagebox list with a link in one of the sublists:
<div class="messagebox">
*List item 1
**[[Sublist]] item 1
***Subsublist 1 item 1
***Subsublist 1 item 2
**Sublist item 2
***Subsublist 2 item 1
***Subsublist 2 item 2
</div>

Actual Results:
The "messagebox" list is flat list without any indentation.
The second list has "normal" indentation of the sublists.
The third example has inconsistent indentation of the subsublists.

Expected Results:
All lists have indented sublists.

Event Timeline

This seems to be about .messagebox :only-child defining margin: 0; in MW Core's resources/src/mediawiki.skinning/normalize.less.

(Hmm, did the subscribed folks explicitly asked to get subscribed? Just wondering about notification spam...)

(Hmm, did the subscribed folks explicitly asked to get subscribed? Just wondering about notification spam...)

I did not explicitly ask to be subscribed, but I’m glad that I got. As a background, it was @Volker_E was the one who introduced this rule in 1fd66a67edc, and I was the one who asked it to be removed or made more specific. Also, T270796 will make this issue less visible as the generic messagebox class will no longer have it, while boxes specifically opting to use the MediaWiki styles will probably take this rule into account.

Jdlrobson added a subscriber: Jdlrobson.

The messagebox class although originating in Wikimedia code, should possibly not be used in articles. In some skins those styles do not even load (for example Minerva).

The default makes sense here but I agree the correct solution is to move away from the messagebox class to a mw- prefixed class per T270796. Let's decline this task and make sure that happens.