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' ) ) {
|
if ( $this->vectorConfig->get( 'VectorResponsive' ) ) {
|
||||||
$out->addMeta( 'viewport', 'width=device-width, initial-scale=1' );
|
$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 -
|
// 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": {
|
"AutoloadClasses": {
|
||||||
"SkinVector": "SkinVector.php",
|
"SkinVector": "SkinVector.php",
|
||||||
"VectorTemplate": "VectorTemplate.php",
|
"VectorTemplate": "VectorTemplate.php"
|
||||||
"VectorHooks": "Vector.hooks.php"
|
|
||||||
},
|
},
|
||||||
"Hooks": {
|
"@note": "When modifying skins.vector.styles definition, make sure the installer still works",
|
||||||
"ResourceLoaderRegisterModules": [
|
|
||||||
"VectorHooks::onResourceLoaderRegisterModules"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"@note": "skins.vector.styles module registered via a hook",
|
|
||||||
"ResourceModules": {
|
"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": {
|
"skins.vector.js": {
|
||||||
"scripts": [
|
"scripts": [
|
||||||
"collapsibleTabs.js",
|
"collapsibleTabs.js",
|
||||||
|
|
Loading…
Reference in New Issue