As I see it, in-wikitext storage (option 1) has the following benefits and drawbacks:
- Pro: Keeps the styles and the wikitext together now.
- Pro: Will work well with TemplateSandbox now.
- Pro: Ability to use
{{#tag:}}
and such allows for more flexibility, e.g. interpolating template variables into CSS property values. - Con: More clutter in the wikitext.
- Con: CSS will likely not be automatically formatted when editing the page, or highlighted as CSS in general-purpose syntax-highlighting editors.
- Con: Ability to use
{{#tag:}}
and such makes it more difficult to reason about the CSS being produced. - Con: Ability to use
{{#tag:}}
and such prevents catching all errors when the page is saved. - Con: Use of
{{#tag:}}
and such will prevent a future move of those styles to MCR. - Con: Line numbers in error messages will be reported relative to the start of the style block rather than to the start of the containing wikitext page.
As I see it, separate storage (option 2) has the following benefits and drawbacks:
- Pro: Editing the CSS can use a CSS code editor, as is currently the case for user and site CSS.
- Pro: Easy conversion to using MCR once that eventually comes along.
- Pro: Possible to search for styles only using CirrusSearch's contentmodel keyword.
- Con: Keeping the styles and wikitext together is harder (until MCR eventually comes along), very much like how /doc subpages work now.
- Con: Testing edits to both the template and its styles would need to use a sandbox (potentially with Special:TemplateSandbox), at least until MCR comes along.
If we have a magic subpage (or magically-associated namespace) for the separate storage, that has some additional cons. It's easy to avoid all of these if the template has to explicitly include a styles page.
- Con: The magic subpage needs to have protection cascaded from the parent page, which tends to be confusing UI.
- Con: Probably needs a way to enable it for pages used as templates in other namespaces (e.g. user pages that are intended for transclusion).
- Con: Substing the template won't carry the styles over.
Personally, I think separate storage without magic subpages sounds more functional and editor-friendly than in-wikitext storage, but I see SMcCandlish and This, that and the other below prefer in-wikitext storage. I'd like to hear your reasoning.