https://bugzilla.wikimedia.org/show_bug.cgi?id=24915

--- Comment #2 from entli...@gmx-topmail.de 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

body.page-Main_Page 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
http://code.google.com/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors
and https://developer.mozilla.org/en/writing_efficient_css.

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: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- 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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to