mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-23 23:33:54 +00:00
Unbreak styles for installer
The installer hardcodes and expects to find a "skin.vector.styles" module in skin.json, so moving it into a hook broke the styles. Moved it back into skin.json, and left a comment so future developers don't make the same mistake. The responsive code is now a separate module, "skins.vector.styles.responsive", which is only added to the page output if VectorResponsive is enabled. Bug: T106747 Change-Id: I7540b7871531ef650e799f012477cef6cdd32fb7
This commit is contained in:
parent
0eaadb3b14
commit
ac43e74cfb
|
@ -48,6 +48,7 @@ class SkinVector extends SkinTemplate {
|
|||
|
||||
if ( $this->vectorConfig->get( 'VectorResponsive' ) ) {
|
||||
$out->addMeta( 'viewport', 'width=device-width, initial-scale=1' );
|
||||
$out->addModuleStyles( 'skins.vector.styles.responsive' );
|
||||
}
|
||||
|
||||
// Append CSS which includes IE only behavior fixes for hover support -
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
class VectorHooks {
|
||||
/**
|
||||
* Register the 'skins.vector.styles' hook. This is temporary until responsive
|
||||
* mode becomes the default.
|
||||
*/
|
||||
public static function onResourceLoaderRegisterModules( ResourceLoader $rl ) {
|
||||
$config = ConfigFactory::getDefaultInstance()->makeConfig( 'vector' );
|
||||
$definition = array(
|
||||
'position' => 'top',
|
||||
'styles' => array(
|
||||
'screen.less' => array(
|
||||
'media' => 'screen',
|
||||
),
|
||||
'screen-hd.less' => array(
|
||||
'media' => 'screen and (min-width: 982px)',
|
||||
),
|
||||
),
|
||||
'localBasePath' => __DIR__,
|
||||
'remoteSkinPath' => 'Vector'
|
||||
);
|
||||
if ( $config->get( 'VectorResponsive' ) ) {
|
||||
$definition['styles']['responsive.less'] = array( 'media' => 'screen and (max-width: 768px)' );
|
||||
}
|
||||
|
||||
$rl->register( 'skins.vector.styles', $definition );
|
||||
}
|
||||
}
|
29
skin.json
29
skin.json
|
@ -23,16 +23,29 @@
|
|||
},
|
||||
"AutoloadClasses": {
|
||||
"SkinVector": "SkinVector.php",
|
||||
"VectorTemplate": "VectorTemplate.php",
|
||||
"VectorHooks": "Vector.hooks.php"
|
||||
"VectorTemplate": "VectorTemplate.php"
|
||||
},
|
||||
"Hooks": {
|
||||
"ResourceLoaderRegisterModules": [
|
||||
"VectorHooks::onResourceLoaderRegisterModules"
|
||||
]
|
||||
},
|
||||
"@note": "skins.vector.styles module registered via a hook",
|
||||
"@note": "When modifying skins.vector.styles definition, make sure the installer still works",
|
||||
"ResourceModules": {
|
||||
"skins.vector.styles": {
|
||||
"position": "top",
|
||||
"styles": {
|
||||
"screen.less": {
|
||||
"media": "screen"
|
||||
},
|
||||
"screen-hd.less": {
|
||||
"media": "screen and (min-width: 982px)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"skins.vector.styles.responsive": {
|
||||
"position": "top",
|
||||
"styles": {
|
||||
"responsive.less": {
|
||||
"media": "screen and (max-width: 768px)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"skins.vector.js": {
|
||||
"scripts": [
|
||||
"collapsibleTabs.js",
|
||||
|
|
Loading…
Reference in a new issue