TemplateStyles demo

From Notaclue Wiki
Extension demonstration (infobox template)
TemplateStyles
Documentation

on mediawiki.org

Maintained by WikiTeq?

No

Version

This wiki has the TemplateStyles extension installed, which allows users to add additional CSS styles to pages and templates.

Styles are stored in pages with the sanitized-css content model (usually subpages in the Template namespace that end in .css) and then loaded using <templatestyles src="Example/styles.css" />, replacing Example/styles.css with the title of the styles to load (in the Template namespace by default).

While styles can also be added site-wide using MediaWiki:Common.css, TemplateStyles allows limiting the loading of these styles to just the pages where they are needed. For example, the infobox on the top right makes use of Template:Extension demo/styles.css - while it might not hurt to load those styles on all pages, they are only needed on a select few.

Similarly, on the SaveSpinner demonstration page we demonstrate the styles that that extension adds by trying to mimic them using TemplateStyles. The code

<templatestyles src="Template:SaveSpinner styles.css" /> <div class="savespinner-wrapper savespinner-wrapper--visible"><div class="lds-ring"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div></div>

Loaded Template:SaveSpinner styles.css and resulted in:

Cookies help us deliver our services. By using our services, you agree to our use of cookies.