Extension:CSS/pl
Status wydania: stabilne |
|
|---|---|
| Realizacja | Funkcja parsera |
| Opis | Provides a parser-function for adding CSS files, article or inline rules to articles |
| Autor(zy) | |
| Ostatnia wersja | 3.5.0 |
| MediaWiki | >= 1.43.0 |
|
|
| License | GNU General Public License 2.0 or later |
| Pobieranie | |
| Przykład | organicdesign.nz |
| Przetłumacz rozszerzenie CSS jeżeli jest dostępne na translatewiki.net | |
| Problemy | Otwarte zadania · Zgłoś błąd |
The CSS extension allows CSS stylesheets to be included in specific articles. The CSS can be another article, a file or can be rules defined directly within the parser-function.
Użycie
For example, if you have a CSS article called "MyStyles.css", which are the styles intended for use with the article "MyFancyUserPage", you would add the following parser-function syntax to the latter,
{{#css:MyStyles.css}}
If on the other hand "MyStyles.css" was a file in the /wiki/skins directory, then it would be included as shown below. Note that the file must be an absolute path with a leading slash to distinguish it from an article title.
{{#css:/skins/MyStyles.css}}
Alternatively, CSS rules can be directly included within the parser-function (inline) as in the following example,
{{#css:
body {
background: yellow;
color: red;
font-size: 1.25rem;
}
}}
Instalacja
- Pobierz i umieść plik(i) w katalogu o nazwie
CSSw folderzeextensions/.
Developers and code contributors should install the extension from Git instead, using:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CSS
- Tylko w przypadku instalacji z repozytorium git należy uruchomić Composer, aby zainstalować zależności PHP, poprzez wywołanie
composer install --no-devw katalogu rozszerzenia. (Zobacz T173141 w celu uzyskania informacji o możliwych komplikacjach.) - Dodaj poniższy kod na dole twojego pliku LocalSettings.php:
wfLoadExtension( 'CSS' );
- Konfiguracja jest wymagana.
Zrobione – Przejdź do Special:Version na twojej wiki, aby sprawdzić czy rozszerzenie zostało pomyślnie zainstalowane.
Konfiguracja
Optionally, you can set the base URL for external files.
$wgCSSPath = false; # Default, relative to $wgScriptPath
$wgCSSPath = ''; # Relative to the root of your server
$wgCSSPath = 'https://example.org/stylesheets'; # Relative to a different site
Tips
- Changing the color or background of a specific page
Using the parser function to use the CSS from another page does not work to change the color or background of the page, however, using the parser function on a single page by itself does allow the background to be changed. To overcome this problem, it is possible to load the CSS through transclusion, which does not cause the problem of failing to load the change to the page background.
Zobacz też
- Extension:NewPageCSS
- Extension:TemplateStyles - a similar extension which sanitizes the CSS and stores it on separate pages.
| To rozszerzenie jest dołączone do następujących farm/hostów wiki lub pakietów: |
- Stable extensions/pl
- Parser function extensions/pl
- ParserFirstCallInit extensions/pl
- RawPageViewBeforeOutput extensions/pl
- GPL licensed extensions/pl
- Extensions in Wikimedia version control/pl
- All extensions/pl
- Extensions requiring Composer with git/pl
- Extensions included in Miraheze/pl
- Extensions included in MyWikis/pl
- Extensions included in ProWiki/pl
- Extensions included in Telepedia/pl
- User interface extensions/pl
- Script embedding extensions/pl
- CSS/pl
