Topic on Extension talk:TemplateStyles

Styling the page status indicators area

4
UV (talkcontribs)

The page Extension:TemplateStyles states:

  • "Styles added by TemplateStyles are scoped to avoid affecting the user interface outside of the main parsed content.
    • To use TemplateStyles to style something like w:en:MediaWiki:Protectedpagetext, you would need to enclose the message's contents in <div class="mw-parser-output">...</div>."

Is it safe to add <div class="mw-parser-output">...</div> to the contents of an <indicator>...</indicator> tag in order to be able to style the page status indicators area (see Special:Diff/3052169 and Help:Page status indicators) using the TemplateStyles extension?

(If yes, why isn't the page status indicators area wrapped in <div class="mw-parser-output">...</div> by default?)

Anomie (talkcontribs)

Is it safe to add <div class="mw-parser-output">...</div> to the contents of an <indicator>...</indicator> tag in order to be able to style the page status indicators area (see Special:Diff/3052169 and Help:Page status indicators) using the TemplateStyles extension?

Using <div> might introduce unexpected line breaks, you'll have to try it and find out. If it does, you might be able to fix it by switching to <span> or adding style="display:inline-block" or the like.

(If yes, why isn't the page status indicators area wrapped in <div class="mw-parser-output">...</div> by default?)

gerrit:352835 was submitted to do just that. Some people wanted different approaches and blocked that patch, but have yet to submit their own patch to do it the way they want.

Tgr (WMF) (talkcontribs)

On the other hand using a span might also have unexpected results if the contents include block elements... it's possible to add a wrapper knowing the specific skin and wiki style, but not in general, I think.

UV (talkcontribs)

Thank you! I have tested the div and it works fine in all skins installed on WMF without any undesired line breaks.

Reply to "Styling the page status indicators area"