mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 07:43:47 +00:00
cec2337aac
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
30 lines
801 B
PHP
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 );
|
|
}
|
|
}
|