42 $default = !is_array( $logo ) ? $logo : $logo[
'1x'];
43 $styles[
'all'][] =
'.mw-wiki-logo { background-image: ' .
44 CSSMin::buildUrlValue( $default ) .
47 if ( is_array( $logo ) ) {
48 if ( isset( $logo[
'svg'] ) ) {
49 $styles[
'all'][] =
'.mw-wiki-logo { ' .
50 'background-image: -webkit-linear-gradient(transparent, transparent), ' .
51 CSSMin::buildUrlValue( $logo[
'svg'] ) .
'; ' .
52 'background-image: linear-gradient(transparent, transparent), ' .
53 CSSMin::buildUrlValue( $logo[
'svg'] ) .
';' .
54 'background-size: 135px auto; }';
56 if ( isset( $logo[
'1.5x'] ) ) {
58 '(-webkit-min-device-pixel-ratio: 1.5), ' .
59 '(min--moz-device-pixel-ratio: 1.5), ' .
60 '(min-resolution: 1.5dppx), ' .
61 '(min-resolution: 144dpi)'
62 ][] =
'.mw-wiki-logo { background-image: ' .
63 CSSMin::buildUrlValue( $logo[
'1.5x'] ) .
';' .
64 'background-size: 135px auto; }';
66 if ( isset( $logo[
'2x'] ) ) {
68 '(-webkit-min-device-pixel-ratio: 2), ' .
69 '(min--moz-device-pixel-ratio: 2), ' .
70 '(min-resolution: 2dppx), ' .
71 '(min-resolution: 192dpi)'
72 ][] =
'.mw-wiki-logo { background-image: ' .
73 CSSMin::buildUrlValue( $logo[
'2x'] ) .
';' .
74 'background-size: 135px auto; }';
102 if ( !is_array( $logo ) ) {
104 $preloadLinks[$logo] = [
'as' =>
'image' ];
105 return $preloadLinks;
108 if ( isset( $logo[
'svg'] ) ) {
111 $preloadLinks[$logo[
'svg']] = [
'as' =>
'image' ];
112 return $preloadLinks;
115 foreach ( $logo as $dppx => $src ) {
117 $dppx = substr( $dppx, 0, -1 );
118 $logosPerDppx[$dppx] = $src;
122 uksort( $logosPerDppx,
function ( $a, $b ) {
129 foreach ( $logosPerDppx as $dppx => $src ) {
136 $logosCount = count( $logos );
142 for ( $i = 0; $i < $logosCount; $i++ ) {
147 $media_query =
'not all and (min-resolution: ' . $logos[1][
'dppx'] .
'dppx)';
148 } elseif ( $i !== $logosCount - 1 ) {
153 $upper_bound = floatval( $logos[$i + 1][
'dppx'] ) - 0.000001;
154 $media_query =
'(min-resolution: ' . $logos[$i][
'dppx'] .
155 'dppx) and (max-resolution: ' . $upper_bound .
'dppx)';
158 $media_query =
'(min-resolution: ' . $logos[$i][
'dppx'] .
'dppx)';
161 $preloadLinks[$logos[$i][
'src']] = [
163 'media' => $media_query
167 return $preloadLinks;
179 foreach (
$styles as $key => $val ) {
180 if ( !is_array( $val ) ) {
195 $logo = $conf->
get(
'Logo' );
196 $logoHD = $conf->
get(
'LogoHD' );
198 $logo1Url = OutputPage::transformResourcePath( $conf, $logo );
208 if ( isset( $logoHD[
'svg'] ) ) {
209 $logoUrls[
'svg'] = OutputPage::transformResourcePath(
215 if ( isset( $logoHD[
'1.5x'] ) ) {
216 $logoUrls[
'1.5x'] = OutputPage::transformResourcePath(
221 if ( isset( $logoHD[
'2x'] ) ) {
222 $logoUrls[
'2x'] = OutputPage::transformResourcePath(
243 $summary = parent::getDefinitionSummary(
$context );
245 'logo' => $this->
getConfig()->get(
'Logo' ),
246 'logoHD' => $this->
getConfig()->get(
'LogoHD' ),