Extension:TemplateStylesExtender/cs
![]() Stav rozšíření: stabilníCategory:Stable extensions/cs |
|
---|---|
Implementace | Rozšíření syntaktického analyzátoruCategory:Parser extensions/cs |
Popis | Extends Extension:TemplateStyles with new selectors |
Autoři | Octfxdiskuse |
Nejnovější verze | 1.2.0 (2023-07-19) |
MediaWiki | 1.39+Category:Extensions with manual MediaWiki version |
PHP | >=8.0 |
Composer | octfx/template-styles-extenderCategory:Extensions supporting Composer/cs |
Licence | GNU General Public License 2.0 nebo novější |
Stáhnout | GitHub: Poznámka: |
|
|
Rozšíření TemplateStylesExtender rozšiřuje Extension:TemplateStyles o nové selektory a párovače.
Funkce
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
- Download soubor/y a vložte je do adresáře pojmenovaného
TemplateStylesExtender
ve vaší složceextensions/
. - Na konec vašeho souboru LocalSettings.php přidejte následující kód:
wfLoadExtension( 'TemplateStyles' ); wfLoadExtension( 'TemplateStylesExtender' );
- Configure as required.
Dokončeno – Přejděte na stránku Special:Version vaší wiki a zkontrolujte, zda bylo rozšíření úspěšně nainstalováno.
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.See also
![]() | Toto rozšíření je zahrnuto v následujících wiki farmách/hostitelích a/nebo balíčcích: Toto není autoritativní seznam. Některé wiki farmy/hostitelé a/nebo balíčky mohou toto rozšíření obsahovat, i když zde nejsou uvedeny. Pro potvrzení se vždy obraťte na své wiki farmy/hostitele nebo balíček. |
Category:All extensions/cs
Category:Extensions in GitHub version control/cs
Category:Extensions included in Miraheze/cs
Category:Extensions included in MyWikis/cs
Category:Extensions included in WikiForge/cs
Category:Extensions supporting Composer/cs
Category:Extensions with manual MediaWiki version
Category:GPL licensed extensions/cs
Category:ParserFirstCallInit extensions/cs
Category:Parser extensions/cs
Category:Stable extensions/cs
Category:TemplateStylesPropertySanitizer extensions/cs
Category:TemplateStylesStylesheetSanitizer extensions/cs