mediawiki-skins-Vector/Vector.hooks.php
Jack Phoenix cec2337aac Make Vector more responsive
This functionality is off by default, behind a configuration variable
($wgVectorResponsive) by popular developer demand.

CSS/LESS code by James Hare, with tweaks and testing by Jack Phoenix.

Bug: T46387
Change-Id: Ib611357bbce739b1d193abaf89c228ba52613d6a
2015-07-18 16:54:33 +00:00

30 lines
801 B
PHP

<?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 );
}
}