Erweiterung:TemplateStylesExtender
Appearance
Freigabestatus: stabil |
|
|---|---|
| Einbindung | Parser-Erweiterung |
| Beschreibung | Extends Erweiterung:TemplateStyles with new selectors |
| Autor(en) | OctfxDiskussion |
| Letzte Version | 2.1.0 |
| Kompatibilitätspolitik | Der Master behält die Abwärtskompatibilität bei. |
| MediaWiki | >= 1.43.0 |
| PHP | >=8.0 |
| Datenbankänderungen | Nein |
| Composer | octfx/template-styles-extender |
|
|
| Licence | GNU General Public License 2.0 oder neuer |
| Herunterladen | |
The TemplateStylesExtender extension extends Erweiterung:TemplateStyles with new selectors and matchers. TemplateStylesExtender is developed based on css-sanitizer 5.5.0, which is being used by MediaWiki 1.43.
Features
- Declare CSS custom properties/variables
- Use CSS custom properties/variables in most properties
- Implement additional properties and values as listed below
Installation
- Die Download und die Datei(en) in ein Verzeichnis namens
TemplateStylesExtenderim Ordnerextensions/ablegen. - Folgenden Code am Ende deiner LocalSettings.php-Datei einfügen:
wfLoadExtension( 'TemplateStyles' ); wfLoadExtension( 'TemplateStylesExtender' );
- Konfiguriere nach Bedarf.
Erledigt – Navigiere zu Special:Version in deinem Wiki, um zu überprüfen, ob die Erweiterung erfolgreich installiert wurde.
Konfiguration
| Configuration | Beschreibung | Default |
|---|---|---|
$wgTemplateStylesExtenderCustomPropertiesDeclaration
|
Allow CSS custom properties (CSS variables) to be declared as properties | true
|
$wgTemplateStylesExtenderExtendCustomPropertiesValues
|
Allow the CSS custom properties (CSS variables) to be used as values in all properties | true
|
$wgTemplateStylesExtenderEnableUnscopingSupport
|
Allows users with unscope permissions to unscope CSS by setting a wrapclass attribute.
|
false
|
$wgTemplateStylesExtenderUnscopingPermission
|
Specify a permission group that is allowed to unscope CSS. | editinterface
|
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
| Diese Erweiterung ist in den folgenden Softwarepaketen enthalten und/oder wird von den folgenden Wiki-Farmen, bzw. Wiki-Hostern verwendet: |
Categories:
- Stable extensions/de
- Parser extensions/de
- Extensions supporting Composer/de
- ParserFirstCallInit extensions/de
- TemplateStylesPropertySanitizer extensions/de
- TemplateStylesStylesheetSanitizer extensions/de
- GPL licensed extensions/de
- Extensions in GitHub version control/de
- All extensions/de
- Extensions included in Canasta/de
- Extensions included in Miraheze/de
- Extensions included in MyWikis/de
- Extensions included in ProWiki/de
- Extensions included in Telepedia/de
- Extensions included in Weird Gloop/de
- Extensions included in wiki.gg/de
