You are browsing a read-only backup copy of Wikitech. The primary site can be found at


From Wikitech-static
< User:BryanDavis‎ | Sandbox
Revision as of 19:23, 17 May 2021 by imported>BryanDavis (→‎Example usage: Add more detail and subheadings)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

How can I use Extension:Templatestyles outside of the "Template" namespace?

Example usage


<templatestyles src="User:BryanDavis/Sandbox/Templatestyles/styles.css" />
[[File:Dont panic.svg|class=width200 custom-img-style-via-templatestyles]]

CSS styles

.custom-img-style-via-templatestyles { border:2px dotted green; } .width200 { width: 200px; height: auto; /* preserve aspect ratio */ }


Dont panic.svg

How to

  • Create style page somewhere on your wiki. This example will use path/to/style/page.css in later steps.
  • Use Special:ChangeContentModel to set the content model of that page to "Sanitized CSS"
  • Add <templatestyles src="path/to/style/page.css"/> to a content page
  • Add custom styles as needed to your style page
  • Use custom styles as needed in your content page
  • Don't Panic! :)