The Hindi and Russian Wikipedia and Wikivoyages communities have built/are building main pages that are drastically different from other pages built is via MediaWiki:Common.css. The downside of this is that various unused styles are shipped to every single page of the site.
If you take a look at https://en.wikivoyage.org/wiki/MediaWiki:Common.css you'll see the majority of rules here relate to the main page.
Recently, the reading web team had to introduce MediaWiki:MobileMainPage.css to allow styles to ship on the mobile version of the main page to support a change by the Hindi Wikipedia community. Our hope was to quickly deprecate this (T195813) but with T195905 it seems like we are in danger of making this a defacto standard in MobileFrontend.
Rather than have yet another example of a mobile specific change, I'd like to see this change in core if we do need to support it.
The problem is that many of these Main page designs, touch elements outside the content area - concrete examples we have seen so far are:
- changing the background color
- hiding interface elements e.g. edit link/heading
This means TemplateStyles cannot be used (see T162379)
It seems like all projects would benefit from having a separate interface page to control styling the main page.
Possible solutions
- T162379 is resolved by special casing the main page.
- Introduce MediaWiki:Mainpage.css
- Forbid changes outside the content area and standardise these changes as being skin specific.
Strawman specification for MediaWiki:Mainpae.css
This is just a proposal - other solutions welcomed
- Content inside MediaWiki:Mainpage.css would be treated as CSS.
- Content inside MediaWiki:Mainpage.css would be loaded on both mobile and desktop for the MainPage only.
- If Main page is localised, styles will be loaded on the localised wiki page name
- To allow editors to test designs it should be possible for MediaWiki:Mainpage.css to load on certain draft pages. Potentially this should be all subpages e.g. "MainPage/draft"
- Content inside MediaWiki:Mainpage.css will not be loaded on any pages outside the Mainpage.