MediaWiki Default Styles

From mw.mh370.wiki
Jump to navigation Jump to search


A Guide to Using MediaWiki in a Hosted Environment

An instructional website by the developer of mh370wiki.net - a MediaWiki site about Malaysia Airlines Flight MH370.


The concept of Cascading Style Sheets is that a hierarchy permits inheritance but to override the style inherited by an element requires understanding the cascade.

MediaWiki has various styles pre-defined which are loaded as default styles.

Just as the configuration settings in Localsettings.php override MediaWiki default configurations, styles (CSS) created in MediaWiki:Common.css override MediaWiki default styles.

Similarly, a customised appearance for the interface can be developed by styles (CSS) in MediaWiki:Vector.css which override the Vector skin default styles.

If Vector is not the default skin, the custom CSS will be in MediaWiki:Skin Name.css

Finding MediaWiki Default Styles

One location with many style sheets in .less format is the directory /w/resources/src/mediawiki.skinning

Some of the interesting files are:-

/w/resources/src/mediawiki.skinning

  • content.body.less - defines mw-body-content
  • content.tables.less - defines a usable class .wikitable
  • content.elements.less - defines styles for elements including headings, links, paragraphs, lists
  • i18n-all-lists-margins.less - default margins for list types ul, ol and dd
  • interface-site-notice.less - position and alignment of #sitenotice
  • interface-subtitle.less
  • interface.category.less

/w/resources/src/mediawiki.less

  • mediawiki.skin.defaults - defines a lot of default colors

/w/resources/src/mediawiki.page.gallery



See Also: Vector Skin Styles