Extension:TemplateStylesExtender: Difference between revisions
Appearance
Content deleted Content added
mNo edit summary Tag: 2017 source edit |
m Translate extension now adds untranslated anchors |
||
Line 44: | Line 44: | ||
}} |
}} |
||
{{anchor|Configuration}} |
|||
<translate> |
<translate> |
||
== Configuration == <!--T:5--> |
== Configuration == <!--T:5--> |
Revision as of 08:12, 26 November 2022
TemplateStylesExtender Release status: stable |
|
---|---|
Implementation | Parser extension |
Description | Extends Extension:TemplateStyles with new selectors |
Author(s) | Octfxtalk |
Latest version | 1.1.0 (2022-09-30) |
MediaWiki | 1.35+ |
PHP | 7.2+ |
Composer | octfx/template-styles-extender |
License | GNU General Public License 2.0 or later |
Download | GitHub: Note: |
|
|
The TemplateStylesExtender extension extends Extension:TemplateStyles with new selectors and matchers.
Features
- Add support for CSS variables
- Example
color: var( --color-base )
- Example
- Add support for
image-rendering
- Add support for
ruby-position
- Add support for
ruby-align
- Add support for
scroll-margin-*
andscroll-padding-*
- Add support for
@media (prefers-color-scheme: dark/light)
media queries - Add support for
mask-image
- Add support for
clamp
- Add support for
revert / revert-layer
- Add support for
aspect-ratio
Installation
- Download and place the file(s) in a directory called
TemplateStylesExtender
in yourextensions/
folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'TemplateStyles' ); wfLoadExtension( 'TemplateStylesExtender' );
- Configure as required.
- Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration
Key | Description | Example | Default |
---|---|---|---|
$wgTemplateStylesExtenderEnablePrefersColorScheme | Flag to enable @media (prefers-color-scheme: dark/light) media queries
|
false | true |
$wgTemplateStylesExtenderEnableCssVars | Flag to enable css vars | false | true |
Note CSS Vars
Currently using :root
selectors won't work due to template styles prepending .mw-parser-output
.
One possible fix is to wrap the entire content into a `div` element and adding the declarations to this, e.g.
div#content-wrap { --padding: 10px } .content { padding: var( --padding ) }
Wikitext
<div id="content-wrap"> <div class=".content"> The WikiText... </div> </div>