Extension:TemplateStylesExtender/pl
Appearance
From mediawiki.org
This page is a translated version of the page Extension:TemplateStylesExtender and the translation is 5% complete.
Status wydania: stabilne |
|
|---|---|
| Realizacja | Rozszerzenie parsera |
| Opis | Extends Extension:TemplateStyles with new selectors |
| Autor(zy) | Octfx dyskusja |
| Ostatnia wersja | 2.2.0 |
| Polityka zgodności | Master utrzymuje kompatybilność wsteczną. |
| MediaWiki | >= 1.43.0 |
| PHP | >=8.0 |
| Zmiany w bazie danych | Nie |
| Composer | octfx/template-styles-extender |
|
|
| Licence | Licencja GNU General Public License 2.0 lub nowsza |
| Pobieranie | |
The TemplateStylesExtender extension extends Extension: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
Instalacja
- Download i umieść plik(i) w katalogu o nazwie
TemplateStylesExtenderw swoim kataloguextensions/. - Dodaj poniższy kod na dole twojego pliku LocalSettings.php :
wfLoadExtension( 'TemplateStyles' ); wfLoadExtension( 'TemplateStylesExtender' );
- Configure as required.
- Yes Zrobione – Przejdź do
Special:Versionna twojej wiki, aby sprawdzić czy rozszerzenie zostało pomyślnie zainstalowane.
Konfiguracja
| Configuration | Description | 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.
Zobacz też
Categories:
- Stable extensions/pl
- Parser extensions/pl
- Extensions supporting Composer/pl
- ParserFirstCallInit extensions/pl
- TemplateStylesPropertySanitizer extensions/pl
- TemplateStylesStylesheetSanitizer extensions/pl
- GPL licensed extensions/pl
- Extensions in GitHub version control/pl
- All extensions/pl
- Extensions included in Canasta/pl
- Extensions included in Miraheze/pl
- Extensions included in MyWikis/pl
- Extensions included in ProWiki/pl
- Extensions included in Telepedia/pl
- Extensions included in Weird Gloop/pl
- Extensions included in wiki.gg/pl