User:BryanDavis/Sandbox/Templatestyles
Appearance
How can I use Extension:Templatestyles outside of the "Template" namespace?
Example usage
Wikitext
<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 */ }
Result
How to
- Create style page somewhere on your wiki. This example will use
path/to/style/page.css
in later steps.- The visual example above uses User:BryanDavis/Sandbox/Templatestyles/styles.css as the style page.
- Use Special:ChangeContentModel to set the content model of that page to "Sanitized CSS"
- See mw:Help:ChangeContentModel for more information
- 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! :)