--- Comment #2 from 2010-08-25 02:10:25 UTC ---
The main use case of these classes currently is serving as the start of a
descendant selector in order to change things depending on the namespace or
page name or skin (e.g. [[MediaWiki:Monobook.css]], [[MediaWiki:Print.css]]
etc.). For this use case, it doesn't matter if the descendant is a body or a
html or a div or whatever.

A secondary use case is increasing specifity. That is IMHO somewhat
questionable as it mixes unrelated things, but that would still be possible, it
just needs to be written differently (e.g. body.mediawiki becomes
html.mediawiki or .mediawiki body).

Clashes are certainly possible, but when do they occur? Header IDs can clash
with interface IDs just if the header text happens to be the same as an
interface ID, but classes are different; I'm not aware of any place where user
input is translated to a class name. Users could of course hand-craft things to
clash with interface classes, but what's the point in that? Given the (IMHO
unnecessarily specific) rule h1.firstHeading { display: none !important; }

that could just as well be

.page-Main_page .firstHeading { display: none !important }

they would have to hand-craft two class names just to get something not
displayed. It's much easier to just add style="display: none;" to it.

Adding tag names for the purpose of avoiding clashes also doesn't scale very
well. It incidentally works for body (but also html) because user can't add
body and html tags, but fails with many other tags. On the other hand, omitting
unnecessary tag names is sometimes recommended for performance reasons, see

The advantage of moving the classes to the root element is that users could,
for example, put stuff with descendant selectors that start with .mediawiki
into the user style sheets of their browsers (e.g. chrome/userContent.css in
the Mozilla profile directory) in order to customize all MediaWiki
installations at once, including the root element. I don't know how many people
are actually doing that, but it's a useful thing to do and already possible,
with the restriction that the root element cannot be styled this way.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

Wikibugs-l mailing list

Reply via email to