Jump to content

Extension:CSS/pl

From mediawiki.org
This page is a translated version of the page Extension:CSS and the translation is 25% complete.
Podręcznik rozszerzeń MediaWiki
CSS
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
  • $wgCSSIdentifier
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 CSS w folderze extensions/.
    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-dev w 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.
  • Yes 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ż