Extension:TemplateStyles/Q&A

 What is the most convenient way to apply styling to templates?

About and Rationale
The extensionTemplateStyles allows CSS styling to be added to templates. This will result in more flexibility in both the way templates are visually designed, plus a better adaptability to screen options, i.e. no more garbled templates view on mobile devices. By providing a better and more mobile friendly page rendering, we are better able to deliver the sum of all knowledge, in a more refined experience, to all our mobile readers. More info on Phabricator task T155813.

We need to decide on the best way to add styling to templates. Where the CSS gets stored will basically determine how the extension is being built, so once we decide on this, other architecture decisions are dependent on it, and therefore it will be very inefficient to change our minds and redo all the work again.

Workflow changes
Adding CSS to existing or new templates can be implemented in two ways. Since the extension is still under development, we would like to get a better understanding of how well these options would fit into the workflow of template editors and patrollers, so we know if one of these is not an option when planning the architecture.

1. Store CSS in template page
The CSS code will be inserted within the parser tags. This is very flexible - template authors can use #tag or Scribunto to include template parameters, fetch CSS from another page, or even generate dynamic CSS code.

2. Store CSS in a separate page
In this option, styling will live in a separate subpage, something like. With this option, restrictions to template styling could be applied (anyone can edit the template, but a certain user right might be required to edit styling, which has more potential for vandalism). It will also be easier to search templates by style (example: find templates with non-mobile-friendly styles) or watch a template for CSS changes only. In the future, when the multi-content revisions project is finished, subpages can be replaced by "slots", virtual subpages which behave as part of the page for purposes of moving, history etc.

Another possibility here would be to load the styles explicitly with a tag, e.g., instead of using a magic subpage.

Rollout plan open questions

 * 1) Shall we target specific, no so heavily used templates as a "test" templates