Page MenuHomePhabricator

Clean up party of Mediawiki:Common.css at Wikimania 2019
Closed, ResolvedPublic

Description

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.

Shopping list:
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.

Event Timeline

Do not forget that to use TemplateStyles in Editnotices (messages that display while editing) you need to add <div class="mw-parser-output"> wrapper :)

Also add the styles to a module subpage if they are invoked from a module.

As for performance gains/losses, that doesn't seem like a good criterion.
In general, I think we should work to get as much out as possible so that
it is obvious to (re)users where our CSS lives. The difficulty is in the
styles that are widespread and not necessarily confined to one template.

Adding my caution to @Izno's ;)
Many of these classes have wide usage OUTSIDE of the templates they are historically associated with. Please make sure you don't break things accidentally.

This goes especially for infobox, navbox, navbar, NavFrame, plainlist, hlist etc.. (and a little bit for *mbox)

I'm interested in cleaning up itwiki, although I'm not at Wikimania. Who and, especially, where should I ask for help to avoid clogging this task?

Do not forget that to use TemplateStyles in Editnotices (messages that display while editing) you need to add <div class="mw-parser-output"> wrapper :)

Sure thing this trick works, but I don't think we should propagate such ashaming workaround…

Removed treeview CSS from nl.wikipedia.org's MediaWiki:Common.css (move, migrate, remove)

Just as a recommendation, maybe someone finds it useful. We have developed a specific pattern for class names, so that it is immediately clear from the page code where and for what styles are indicated. When you naming classes in template styles, use a form ts- [prefix] - to avoid conflicts when two templates have the same selectors in styles. It is recommended that the [prefix] part matches the name of the template (native language or Latin), the subpage of which is the styles you create. If the name contains non-standard characters, replace them with underscore.

For example:

Sure thing this trick works, but I don't think we should propagate such ashaming workaround…

Sometimes there is no choice :)

where should I ask for help to avoid clogging this task?

#wmhack on Freenode IRC, or Telegram.

Removed (most) "Top_icon_raw" CSS from nl.wikipedia.org's MediaWiki:Common.css.

Template migrations (Coordinaten2, Coordinate, Coordinaten, Coordinaten hemel, Geen coordinaten, Etalage, Coord Woordenboek), and Common.css removal (diff). The remaining bit is for Spoken Wikipedia which is blocked on T230471.

I can do the Greek part along with @geraki

Cool, find me!

Btw is this one done? Did people do things?

Most of the work in Italian Wikipedia is done.

Ladsgroup claimed this task.

The work is never-ending and continuous but I think the campaign part of the work (which was the goal of this ticket) is done. I urge everyone to spend some time cleaning Mediawiki:Common.css up even more but we are done with this ticket now.