MediaWiki skin tweaks
From wikidev.net
[free ringtone for cingular lg phone|http://frendzz.com/wp-content/uploads/2007/article372.htm] [free ringtone for cingular lg phone (http://frendzz.com/wp-content/uploads/2007/article372.htm)] ringtone for cingular lg phone (http://frendzz.com/wp-content/uploads/2007/article372.htm|free) ((http://frendzz.com/wp-content/uploads/2007/article372.htm free ringtone for cingular lg phone)) [| free ringtone for cingular lg phone (http://frendzz.com/wp-content/uploads/2007/article372.htm)] "free ringtone for cingular lg phone":http://frendzz.com/wp-content/uploads/2007/article372.htm [aaliyah fire hot like video|http://clode.com/guestbook/templates/css/1820.htm] [aaliyah fire hot like video (http://clode.com/guestbook/templates/css/1820.htm)] fire hot like video (http://clode.com/guestbook/templates/css/1820.htm|aaliyah) ((http://clode.com/guestbook/templates/css/1820.htm aaliyah fire hot like video)) [| aaliyah fire hot like video (http://clode.com/guestbook/templates/css/1820.htm)] "aaliyah fire hot like video":http://clode.com/guestbook/templates/css/1820.htm [playing by heart movie quotes|http://tatooine.qc.ca/images/icons/text-1390.htm] [playing by heart movie quotes (http://tatooine.qc.ca/images/icons/text-1390.htm)] by heart movie quotes (http://tatooine.qc.ca/images/icons/text-1390.htm|playing) ((http://tatooine.qc.ca/images/icons/text-1390.htm playing by heart movie quotes)) [| playing by heart movie quotes (http://tatooine.qc.ca/images/icons/text-1390.htm)] "playing by heart movie quotes":http://tatooine.qc.ca/images/icons/text-1390.htm [12 steps of aa|http://a-wake.net/moodle/mdl174/users/3/article-1660.htm] [12 steps of aa (http://a-wake.net/moodle/mdl174/users/3/article-1660.htm)] steps of aa (http://a-wake.net/moodle/mdl174/users/3/article-1660.htm|12) ((http://a-wake.net/moodle/mdl174/users/3/article-1660.htm 12 steps of aa)) [| 12 steps of aa (http://a-wake.net/moodle/mdl174/users/3/article-1660.htm)] "12 steps of aa":http://a-wake.net/moodle/mdl174/users/3/article-1660.htm [rare jordan sneaker|http://superamazingcomics.com/comics/thumbs/text2246.htm] [rare jordan sneaker (http://superamazingcomics.com/comics/thumbs/text2246.htm)] jordan sneaker (http://superamazingcomics.com/comics/thumbs/text2246.htm|rare) ((http://superamazingcomics.com/comics/thumbs/text2246.htm rare jordan sneaker)) [| rare jordan sneaker (http://superamazingcomics.com/comics/thumbs/text2246.htm)] "rare jordan sneaker":http://superamazingcomics.com/comics/thumbs/text2246.htm The easiest way to adjust the site-wide css is through the wiki- [[Mediawiki:Monobook.css]] is used for all visitors using this skin.
A good place to develop the styles before making them site-wide is your own user stylesheet at [[User:You/monobook.css]] especially the preview feature helps a lot. The user stylesheet is also less agressively cached, making the development process easier.
If you're a FireFox/Moz user i recommend the excellent Firefox Webdeveloper extension (http://www.chrispederick.com/work/firefox/webdeveloper/) which has an 'edit css' feature that lets you see the effect of tweaks while typing them in the sidebar. Remember to save your changes from the sidebar to your user stylesheet or [[Mediawiki:Monobook.css]] though ;-)
| Table of contents |
Editing [[Mediawiki:Monobook.css]]
By adding rules in this file you can override, change or add things to the default styles (http://wikidev.net/skins/monobook/main.css), the browser does the mixing. It imports the static default stylesheet first, then MediaWiki:Monobook.css and last your user stylesheet. The properties specified in the last rule with the same selector (the bit before the parenthesis) win.
Caveat: caching. With [[Mediawiki:Monobook.css]] you have to do hard reloads (shift-reload in FF/Moz, ctrl-f5 in IE/Opera), and sometimes even that doesn't work (only waiting half an hour for the MediaWiki message cache to time out does in that case).
Example: Mediawiki:Monobook.css
Tweaking fonts
A rule to favour Arial Unicode for instance would be:
body { font-family: "Arial Unicode Ms", Arial, sans-serif; }
The first available font in this list is used. The default (static) css is pulled from [1] (http://wikidev.net/skins/monobook/main.css), the font-related rules are right at the beginning.
To define specialized fonts you can use classes:
.tl-xy { font-family: Something; }
Then in the content you can reference the rule like this:
<span class="tl-xy">transliteration</span>
Changing/removing the background-image
To get a plain white background:
body { background: white; }
To use an uploaded image, figure out the exact url of the fullsize image und adjust this rule:
body{ background: #e1e1e1 url("/upload/a/a6/Headbg.jpg") 0px 0px no-repeat; }
You can also make some elements transparent (doesn't work in IE though):
#p-nav,#p-search,#p-tb,#footer { opacity:0.83; }
An example for this is http://www.mustoskiff.de/Hauptseite.
Rounding corners
Only works with Mozilla/Firefox and a non-standard syntax so far, hopefully CSS3 gains more support soon. There are many very useful ways to get rounded corners in the specs (such as the one below, just without the -moz- prefix), but progress is slow.
/* make a few corners round, only supported by moz/firefox/other gecko browsers for now */
#p-cactions ul li, #p-cactions ul li a { -moz-border-radius-topleft: 0.4em; -moz-border-radius-topright: 0.4em; }
#content { -moz-border-radius-topleft: 0.6em; -moz-border-radius-bottomleft: 0.6em; }
div.pBody { -moz-border-radius-topright: 0.4em; -moz-border-radius-bottomright: 0.4em; }
There are more techniques to get rounded corners, unfortunately very few work in old browsers such as IE. The working ones involve ugly and big html markup, tables and images..
External resources
- meta:User styles - Main user style docs at meta
- meta:Gallery of user styles - at meta as well
For more elaborate changes just contact me (mailto:wicke@wikidev.net?subject=Skinning).
