Extensão:CSS
Estado da versão: estável |
|
|---|---|
| Implementação | Função de análise sintática |
| Descrição | Uma função parser para adicionar arquivos CSS, artigos ou regras incorporadas aos artigos |
| Autor(es) | |
| Última versão | 3.5.0 |
| MediaWiki | >= 1.43.0 |
|
|
| Licence | GNU GPL (Licença Pública Geral) 2.0 ou superior |
| Download | |
| Exemplo | organicdesign.nz |
| Para traduzir a extensão CSS, verifique sua disponibilidade no translatewiki.net | |
| Problemas | Tarefas em aberto · Relatar um bug |
A extensão CSS permite que sejam incluídas folhas de estilo CSS em artigos específicos. O CSS pode ser outro artigo, um arquivo ou pode ser regras definidas diretamente na função parser.
Uso
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;
}
}}
Instalação
- Baixe e mova a pasta extraída
CSSao seu diretórioextensions/.
Desenvolvedores e colaboradores de código, por outro lado, deverão instalar a extensão a partir do Git, usando:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CSS
- Se estiver instalando a partir do Git, execute o Composer para instalar as dependências do PHP através do comando
composer install --no-devno diretório da extensão. (Veja T173141 para possíveis complicações.) - Adicione o seguinte código ao final do seu arquivo LocalSettings.php:
wfLoadExtension( 'CSS' );
- Configure as required.
Concluído – Navegue à página Special:Versionem sua wiki para verificar se a instalação da extensão foi bem sucedida.
Configuration
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
- ==Problemas com a alteração da cor ou o fundo de uma página específica==
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.
Ver também
- Extension:NewPageCSS
- Extension:TemplateStyles - a similar extension which sanitizes the CSS and stores it on separate pages.
| Esta extensão está incluída nas seguintes fazendas/hospedagens (farms/hosts) e/ou pacotes wiki: |
- Stable extensions/pt-br
- Parser function extensions/pt-br
- ParserFirstCallInit extensions/pt-br
- RawPageViewBeforeOutput extensions/pt-br
- GPL licensed extensions/pt-br
- Extensions in Wikimedia version control/pt-br
- All extensions/pt-br
- Extensions requiring Composer with git/pt-br
- Extensions included in Miraheze/pt-br
- Extensions included in MyWikis/pt-br
- Extensions included in ProWiki/pt-br
- Extensions included in Telepedia/pt-br
- User interface extensions/pt-br
- Script embedding extensions/pt-br
- CSS/pt-br
