Move capitalize-all-nouns CSS class support from core to MonoBook
Bug: T97892 Change-Id: I598c4469c46d284562ea3aec79330f9a1f40d2ce
This commit is contained in:
parent
bc80783b1e
commit
57e963507c
3 changed files with 30 additions and 4 deletions
|
@ -63,6 +63,29 @@ class SkinMonoBook extends SkinTemplate {
|
|||
] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the "monobook-capitalize-all-nouns" CSS class to the <body> element for German
|
||||
* (de) and various languages which have German set as a fallback language, such
|
||||
* as Colognian (ksh) and others.
|
||||
*
|
||||
* @see https://phabricator.wikimedia.org/T97892
|
||||
* @see https://www.mediawiki.org/wiki/Manual:Hooks/OutputPageBodyAttributes
|
||||
* @param OutputPage $out
|
||||
* @param Skin $skin
|
||||
* @param array &$bodyAttrs Pre-existing attributes for the <body> element
|
||||
*/
|
||||
public static function onOutputPageBodyAttributes( OutputPage $out, Skin $skin, &$bodyAttrs ) {
|
||||
$lang = $skin->getLanguage();
|
||||
if (
|
||||
$skin->getSkinName() === 'monobook' && (
|
||||
$lang->getCode() === 'de' ||
|
||||
in_array( 'de', $lang->getFallbackLanguages() )
|
||||
)
|
||||
) {
|
||||
$bodyAttrs['class'] .= ' monobook-capitalize-all-nouns';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param array &$preferences
|
||||
|
|
|
@ -64,10 +64,12 @@ li#pt-userpage {
|
|||
}
|
||||
|
||||
/* Override text-transform on languages where capitalization is significant */
|
||||
.capitalize-all-nouns .portlet h3,
|
||||
.capitalize-all-nouns #p-personal ul,
|
||||
.capitalize-all-nouns #p-cactions ul li a {
|
||||
.monobook-capitalize-all-nouns {
|
||||
.portlet h3,
|
||||
#p-personal ul,
|
||||
#p-cactions ul li a {
|
||||
text-transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sometimes people don't want personal tools to be lowercase! */
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
"monobook": "resources/mediawiki.less"
|
||||
},
|
||||
"Hooks": {
|
||||
"OutputPageBodyAttributes": "SkinMonoBook::onOutputPageBodyAttributes",
|
||||
"GetPreferences": "SkinMonoBook::onGetPreferences"
|
||||
},
|
||||
"MessagesDirs": {
|
||||
|
|
Loading…
Reference in a new issue