Manual:Interface/Stylesheets/ru

MediaWiki:Common.css это Каскадная Таблица Стилей (Cascading Style Sheets) которая загружается после активных Skin's таблиц стилей. Эта таблица стилей загружает все, а схожая таблица стилей, соответствующая определённому скину — именуемая «» — дополняет первую таблицу (см. ниже). Не смотря на то, что только Monobook.css указан в Special:AllMessages, другие таблицы стилей, специфичные для скина, тем не менее будут работать.

Если для установлено значение true, пользователи могут настроить интерфейс под себя, только создав пользовательские подстраницы с lowercase titles (см. Ниже).

Глобальные таблицы стилей не будут загружаться на специальные страницы с ограниченным доступом, такие как вход в систему или настройки, если вы не разрешите.

They also won't load if is used.



Список таблиц стилей


Глобальные таблицы стилей
These are stylesheets that affect all users of the wiki, depending on their setup — what skin they use, their user group, etc.


 * MediaWiki:Common.css - (все скины и все пользователи, кроме MobileFrontend - Мобильного интерфейса)
 * MediaWiki:skinname.css - (для каждого скина, skinname это значение этой переменной в PHP-файле вашего скина, например MediaWiki:Vector.css, MediaWiki:Monobook.css)
 * - (для каждой группы пользователей, например, для MediaWiki:Group-sysop.css)
 * MediaWiki:Noscript.css - (для пользователей, просматривающих без JavaScript; может быть заменен  селектором )
 * MediaWiki:Print.css - (для «печатных версий» страниц)
 * MediaWiki:Mobile.css - (для мобильных тем, используемых с )
 * MediaWiki:Filepage.css - специально предназначены для того, чтобы файловые страницы Викисклада (нелокальные репозитории) работали на «локальных» файловых страницах

Personal stylesheets
These are stylesheets that only yourself and users with the right, usually interface admins, can edit.


 * User:Example/common.css - (все скины — введены в MW v1.17)
 * User:Example/skinname.css - (для каждого скина, например, User:Example/vector.css и User:Example/monobook.css)
 * User:Example/global.css - (для вики семейства, если используется в этом семействе, находящемся на одном сервере)

In the case of conflicting style settings for a piece of content, the resulting setting depends primarily on specificity. For two rules of the same specificity, it depends on order between and within stylesheets: the last wins. See also cascading order. The order can be overriden with the indication "!important", but this should generally be avoided.

CSS selectors
In the Monobook skin, the CSS selectors relevant for the style of the page body include the following. As far as possible, examples are given, which show the result for the current style settings:


 * : link – unvisited link – example: help:index ; default: help:index
 * : visited – visited link
 * : link#contentTop
 * : link.external – http://example ; default:  http://example
 * : link.extiw – interwiki link in page body – example ; default: en:example
 * : link.image – link from full image to image description page
 * : link.internal – link to file itself (Media:), and links from thumbnail and magnifying glass icon to image description page (note that color and font size specified for a.internal are only applicable in the first case) - [[Media:example.png]]
 * : link.new – doesnotexist ; default: doesnotexist
 * .allpagesredirect – abc – redirects in Special:Allpages and Special:Prefixindex
 * body.ns-0, ..., body.ns-15 (namespaces)
 * div#bodyContent
 * div#column-content
 * div#editsection
 * div#globalWrapper
 * div#tocindent
 * div.tocline
 * h1.firstHeading
 * h2
 * h3
 * small – example
 * table.toc
 * : link and : visited – It's a common mistake to use "a" instead of ": link" or ": visited" to style links (unvisited and visited, respectively). Whereas later pseudoclasses apply only to links, "a" applies to both links and named anchors (e.g. ).


 * #p-lang a – for interlanguage links

One may also have the style depend on the value of an attribute, e.g. with the selectors:



to color-code or highlight particular users (including oneself) and/or links to particular pages (like the bolding of watched pages on Recent Changes).


 * See also Help:Watching pages

The watchlist and Recent Changes use two classes:
 * .autocomment example
 * .new (see below)

The page history has classes autocomment and:
 * .user
 * .minor

Thus the font specified for user applies in the page history, but not in the watchlist or Recent Changes.

Edit page
example1 example2
 * Edit box: textarea#wpTextbox1
 * Edit summary box: input#wpSummary

Non-display
One extreme "style" for a text is "display:none;", i.e., not displaying it, e.g.


 * gives p q r

To allow a text to optionally have this style, specify a class or id for it; a user who wants to hide it can then correspondingly specify in their personal CSS:


 * or

Non-displayed links do not work, as opposed to links in a very small font, compare:
 * gives p q r
 * gives p    q     r

It cannot be used to remove text in expressions for template names, parameter names, parameter values, page names in links, etc.

While "display: none;" produces nothing, "visibility: hidden;" produces blank spaces replacing the content; its opposite is "visibility: visible;".

Example:
 * gives p q r

Try inspecting the page with the probably provided with  your browser to find the hidden element.

If you would like to view the hidden text, you could use an add-on for your browser. For example, the add-on is available for Firefox and Chrome. You could add it to your browser and then choose  in that toolbar, to make all hidden elements appear.

Non-print
One can exclude content from being printed (if the browser supports CSS) by declaring the content to be of the "noprint" class:

Variable class or ID
A class or ID can depend on the result produced by a template or on a template parameter, e.g., class="abc ". For one or more of the possible class names, the style of that class can be defined. If the class is undefined it is ignored, so the standard style is used.

In the simplest case, we have e.g., class="abc " and define class abcdef. If the parameter value is "def", it applies.

If a page for general use only makes sense when styles are defined for certain classes, then these have to be specified in the page MediaWiki:Common.css, which applies for all users and all skins, as far as not overridden.

Variable style parameter value
Wikitext like Wed displays "Wed" if parameter 3 is defined, but its value is not "none", and displays nothing if parameter 3 is undefined or "none". If the value of parameter 3 is a display style other than "none", that style is applied.



См. также

 * Manual:Gallery of user styles
 * Manual:Gallery of user styles