Extension:TemplateStylesExtender/de-formal
TemplateStylesExtender Release status: stable |
|
---|---|
Implementation | Parser extension |
Description | Extends Extension:TemplateStyles with new selectors |
Author(s) | OctfxDiskussion |
Latest version | 1.2.0 (2023-07-19) |
MediaWiki | 1.39+ |
PHP | >=8.0 |
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
image-rendering
ruby-position
ruby-align
scroll-margin-*
andscroll-padding-*
@media (prefers-color-scheme: dark/light)
media queriesmask-image
clamp
revert / revert-layer
aspect-ratio
Installation
- Die Download und die Datei(en) in ein Verzeichnis namens
TemplateStylesExtender
im Ordnerextensions/
ablegen. - Folgenden Code am Ende Ihrer LocalSettings.php -Datei hinzufügen:
wfLoadExtension( 'TemplateStyles' ); wfLoadExtension( 'TemplateStylesExtender' );
- Configure as required.
- Done – Zu Special:Version in dem Wiki (bei Einstellung auf deutsch nach Spezial:Version) navigieren, um die erfolgreiche Installierung der Erweiterung zu überprüfen.
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 |
$wgTemplateStylesExtenderEnableUnscopingSupport | Flag to enable unscoping of CSS by users with editinterface permissions | true | false |
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>
Unscoping of CSS
Example: <templatestyles src="Foo/style.css" wrapclass="mediawiki" />
results in the CSS being scoped to .mediawiki
instead of .mw-parser-output
.
Including such a call in a page essentially limits editing to users with the
editinterface
right. You can alternatively include a call to a template that includes the styles.
Siehe auch
This extension is included in the following wiki farms/hosts and/or packages: This is not an authoritative list. Some wiki farms/hosts and/or packages may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |
Categories:
- Stable extensions/de-formal
- Parser extensions/de-formal
- Extensions supporting Composer/de-formal
- GPL licensed extensions/de-formal
- Extensions in GitHub version control/de-formal
- EditPage::attemptSave extensions/de-formal
- ParserFirstCallInit extensions/de-formal
- TemplateStylesPropertySanitizer extensions/de-formal
- TemplateStylesStylesheetSanitizer extensions/de-formal
- All extensions/de-formal
- Extensions included in Miraheze/de-formal
- Extensions included in WikiForge/de-formal