This ticket is made to track and coordinate the work done in Wikimania 2019 to clean up Mediawiki:Common.css of wikis by using TemplateStyles to improve performance of wikis.
How to guide for interface admins:
- Look at Mediawiki:Common.css of your wiki, check CSS rules that are only there because of very small number of templates. For example .treeview in English Wikipedia is mostly for Template:Tree_list
- Make a sub page of the template, like [[Template:Tree_list/styles.css]], protect if needed
- Invoke the styles in template, for example, if you need it in template, This is an example. If you want to add it to the module, here's another example.
- Remove it from Mediawiki:Common.css
Important points to consider:
- This goes both ways and can cause performance regressions if you move templates that are basically used in most of page views.
- Example of things that can be moved: Styles of dmbox (disambiguation pages), tree view, quote, imbox, cmbox, etc.
- Example of things that should not be moved: Navbox, Reflist.
- Make sure the class is only used in the fixed templates. Some times might copy and need the styles too.
- This only works inside the content part of page, if you have things for header of the main page for example, this won't work :(
- You might need to do a workaround if the template is used in edit notices. (T228604#5352013)
- It won't inject the CSS if the template is not loaded, so things like .hlist has to stay.
List of wiki's that need fixing and who is claiming it. Tick the box if it's claimed and the CSS has been cleaned up.