Jump to content

Help:Extension:ProofreadPage/Index-specific CSS/fi

From mediawiki.org
This page is a translated version of the page Help:Extension:ProofreadPage/Index-specific CSS and the translation is 5% complete.

Every ProofreadPage Index page can have a CSS stylesheet added (as long as Extension:TemplateStyles is installed). This CSS stylesheet is applied to every page in the Page namespace, and also to Page pages that are transcluded with the ‎<pages /> tag.

Creating the stylesheet

To create an Index stylesheet, all you need to do is add a styles.css subpage. For example, create Index:Foobar.djvu/styles.css. This will be automatically applied to all Page-namespace pages in that Index.

Targeting elements

The ability to target specific element on a page depends on the wiki, as these are usually added in templates. Generally, elements are targeted by classes:

.wst-red {
    color: red;
}

It is suggested that classes added by templates use a common prefix (e.g. English Wikisource uses wst-) to make it obvious that a certain class originates in a template.

Using an underscore as a prefix for work-specific classes also makes is less likely that this Index-specific CSS will collide with built-in MediaWiki CSS.

Permitted CSS

The CSS used is a subset of CSS called sanitized-css. Some features are not used, for example data URLs and some browser-prefixed or non-standard CSS properties.

For full details, see Help:TemplateStyles#Allowed CSS properties and rules .

Legacy CSS field

Index pages can have a field called CSS (configured in MediaWiki:Proofreadpage index data config.json; the field name is not case sensitive), but use of this is no longer recommended. This field would load any CSS entered there on every Page page of the Index, but not on any transclusions.

Any styles added with a CSS field should be migrated to an Index-specific subpage, or more general TemplateStyles where appropriate.

Katso myös