mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-28 09:30:17 +00:00
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 );
|
||
|
}
|
||
|
}
|