Extension:NewPageCSS

Category:Outdated pages Category:Extensions without an imageCategory:Extensions without a compatibility policyCategory:GPL licensed extensions
MediaWiki extensions manual
NewPageCSS
Release status: experimentalCategory:Experimental extensions
Implementation Tag Category:Tag extensions, Skin Category:Skin extensions
Description Allows the inclusion of CSS style sheets within wiki pages
Author(s)
Latest version 1.3.0 (2022-07-19)
MediaWiki 1.35+Category:Extensions with manual MediaWiki version
PHP 7.4+
Database changes No
License GNU General Public License 2.0 or later
Download Category:Extensions in GitHub version control
<css>
Translate the NewPageCSS extension if it is available at translatewiki.net
Category:All extensionsCategory:Extensions not in ExtensionJson

The NewPageCSS extension uses the tag <css> to include a CSS in the text of the wiki page; that CSS is then put into the header of the resulting HTML, and so formats your page. If you are creating a wiki page that ends up requiring a lot of style modifiers, it's probably simpler to put them into a CSS style sheet.

Installation

  • Download and place the file(s) in a directory called NewPageCSS in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'NewPageCSS' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage

<css>
table.uc {
    border-collapse: collapse;
}

.uc th {
    background-color: #f2f2f2;
    border: 1px solid black;
}

.uc td {
    border: 1px solid black;
}

.uc td.pm {
    background-color: #ffa0a0;
}
</css>

<table class="uc">

...

</table>

See also

I would like to acknowledge the author of the original extension PageCSS (Ævar Arnfjörð Bjarmason), which I have updated so it will work with current versions of MediaWiki.

Category:User interface extensions Category:Script embedding extensions Category:CSS
Category:All extensions Category:CSS Category:Experimental extensions Category:Extensions in GitHub version control Category:Extensions not in ExtensionJson Category:Extensions with manual MediaWiki version Category:Extensions without a compatibility policy Category:Extensions without an image Category:GPL licensed extensions Category:Outdated pages Category:ParserFirstCallInit extensions Category:Script embedding extensions Category:Skin extensions Category:Tag extensions Category:User interface extensions