From 1d5ec4a6a130cb4e291741a3b32d155ee9932a76 Mon Sep 17 00:00:00 2001 From: jrobson Date: Wed, 4 Dec 2013 17:53:18 -0800 Subject: [PATCH] Move VectorBeta modules to VectorBeta extension * Remove duplication of styles in skins.monobook and skins.vector by creating skins.common. * At same time allow VectorBeta to replace Vector-specific skin styles without having to worry about common styles. Dependency: Ie32a28f8f8c5fc8e4d0890a3d7d96bc82b39c481 Change-Id: Ia193571afffff36ecb1f14ee9036fb9bb98347e7 --- includes/DefaultSettings.php | 1 + includes/installer/WebInstallerOutput.php | 3 +- resources/Resources.php | 29 ++++++--- skins/MonoBook.php | 2 +- skins/Vector.php | 2 +- skins/vector/beta/screen.less | 75 ----------------------- skins/vector/beta/variables.less | 37 ----------- skins/vector/styles-beta.less | 13 ---- 8 files changed, 27 insertions(+), 135 deletions(-) delete mode 100644 skins/vector/beta/screen.less delete mode 100644 skins/vector/beta/variables.less delete mode 100644 skins/vector/styles-beta.less diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index b1265c1b2c..6d6e528ca3 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3344,6 +3344,7 @@ $wgResourceLoaderLESSFunctions = array( */ $wgResourceLoaderLESSImportPaths = array( "$IP/resources/mediawiki.less/", + "$IP/skins/vector/", ); /** diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index 00a4ff8d95..2a3a58440b 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -117,7 +117,8 @@ class WebInstallerOutput { // and loaded as one file. $moduleNames = array( 'mediawiki.legacy.shared', - 'skins.vector', + 'skins.common', + 'skins.vector.styles', 'mediawiki.legacy.config', ); diff --git a/resources/Resources.php b/resources/Resources.php index d2a06b782e..c8f58e30da 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -76,6 +76,17 @@ return array( 'remoteBasePath' => $GLOBALS['wgStylePath'], 'localBasePath' => $GLOBALS['wgStyleDirectory'], ), + 'skins.common' => array( + // Used in the web installer. Test it after modifying this definition! + 'styles' => array( + 'common/commonElements.css' => array( 'media' => 'screen' ), + 'common/commonContent.css' => array( 'media' => 'screen' ), + 'common/commonInterface.css' => array( 'media' => 'screen' ), + ), + 'remoteBasePath' => $GLOBALS['wgStylePath'], + 'localBasePath' => $GLOBALS['wgStyleDirectory'], + ), + // FIXME: Remove in favour of skins.monobook.styles when cache expires 'skins.monobook' => array( 'styles' => array( 'common/commonElements.css' => array( 'media' => 'screen' ), @@ -86,8 +97,8 @@ return array( 'remoteBasePath' => $GLOBALS['wgStylePath'], 'localBasePath' => $GLOBALS['wgStyleDirectory'], ), + // FIXME: Remove in favour of skins.vector.styles when cache expires 'skins.vector' => array( - // Used in the web installer. Test it after modifying this definition! 'styles' => array( 'common/commonElements.css' => array( 'media' => 'screen' ), 'common/commonContent.css' => array( 'media' => 'screen' ), @@ -97,13 +108,17 @@ return array( 'remoteBasePath' => $GLOBALS['wgStylePath'], 'localBasePath' => $GLOBALS['wgStyleDirectory'], ), - 'skins.vector.beta' => array( - // Keep in sync with skins.vector + 'skins.vector.styles' => array( + // Used in the web installer. Test it after modifying this definition! 'styles' => array( - 'common/commonElements.css' => array( 'media' => 'screen' ), - 'common/commonContent.css' => array( 'media' => 'screen' ), - 'common/commonInterface.css' => array( 'media' => 'screen' ), - 'vector/styles-beta.less', + 'vector/styles.less', + ), + 'remoteBasePath' => $GLOBALS['wgStylePath'], + 'localBasePath' => $GLOBALS['wgStyleDirectory'], + ), + 'skins.monobook.styles' => array( + 'styles' => array( + 'monobook/main.css' => array( 'media' => 'screen' ), ), 'remoteBasePath' => $GLOBALS['wgStylePath'], 'localBasePath' => $GLOBALS['wgStyleDirectory'], diff --git a/skins/MonoBook.php b/skins/MonoBook.php index f7fb0d8e73..fdcb0c1654 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -45,7 +45,7 @@ class SkinMonoBook extends SkinTemplate { function setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); - $out->addModuleStyles( 'skins.monobook' ); + $out->addModuleStyles( array( 'skins.common', 'skins.monobook.styles' ) ); // TODO: Migrate all of these $out->addStyle( 'monobook/IE60Fixes.css', 'screen', 'IE 6' ); diff --git a/skins/Vector.php b/skins/Vector.php index 288b5fd6e6..a9ab8fbf64 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -67,7 +67,7 @@ class SkinVector extends SkinTemplate { function setupSkinUserCss( OutputPage $out ) { parent::setupSkinUserCss( $out ); - $styles = array( 'skins.vector' ); + $styles = array( 'skins.common', 'skins.vector.styles' ); wfRunHooks( 'SkinVectorStyleModules', array( &$this, &$styles ) ); $out->addModuleStyles( $styles ); } diff --git a/skins/vector/beta/screen.less b/skins/vector/beta/screen.less deleted file mode 100644 index 6d56cd5c00..0000000000 --- a/skins/vector/beta/screen.less +++ /dev/null @@ -1,75 +0,0 @@ -/* Content */ -#content { - line-height: 1.5em; - .mw-editsection { - font-family: @content-font-family; - } - - h1, - #firstHeading { - font-family: @content-heading-font-family; - font-size: 1.833em; - line-height: 22pt; - padding: 0; - margin-bottom: 4pt; - } - - h2 { - font-size: 1.5em; - line-height: 22pt; - } - - h2, - h3, - h4, - h5, - h6 { - font-family: @content-heading-font-family; - padding: 0; - margin-bottom: 4pt; - margin-top: 14pt; - } - - h3 { - font-size: 1.17em; - line-height: 22pt; - } - - h3, - h4 { - font-weight: bold; - } - - h4, - h5, - h6 { - font-size: 100%; /* (reset) */ - } - - h6 { - font-style: italic; - } - - p { - margin-bottom: 8pt; - } - - // FIXME: this is hacky - #toc h2 { - font-size: 100%; - } -} - -/* Personal menu */ -#p-personal a { - color: #555; -} - -/* Main menu */ -div#mw-panel div.portal { - margin-left: 1.25em; - h3 { - margin: 0; - line-height: 1; - } -} diff --git a/skins/vector/beta/variables.less b/skins/vector/beta/variables.less deleted file mode 100644 index 08e662dc06..0000000000 --- a/skins/vector/beta/variables.less +++ /dev/null @@ -1,37 +0,0 @@ -@html-font-size: 90%; - -@body-font-size: inherit; - -// Page content -@content-font-family: "Helvetica Neue", "Helvetica", "Nimbus Sans L", "Arial", "Liberation Sans", sans-serif; -@content-font-color: #252525; -@content-font-size: 0.9em; -@content-line-height: inherit; -@content-padding: 1em; -@content-heading-font-size: 1.6em; -@content-heading-font-family: Georgia, "DejaVu Serif", serif; - -// Common menu -@menu-link-color: #555; - -// Main menu -@menu-main-font-size: 0.82em; -@menu-main-heading-font-size: 100%; -@menu-main-heading-padding: 5px 0; - -@menu-main-body-font-size: inherit; -@menu-main-body-link-color: inherit; -@menu-main-body-link-visited-color: inherit; -@menu-main-body-margin: 0; -@menu-main-body-padding: 0 0 10px; -@menu-main-logo-left: 1.6em; - -// Personal menu -@menu-personal-font-size: 0.75em; - -// Collapsible nav -@collapsible-nav-heading-color: #555; -@collapsible-nav-heading-collapsed-color: inherit; - -@collapsible-nav-heading-padding: 4px 0 3px 1.5em; -@collapsible-nav-body-margin: 0 0 0 1.25em; diff --git a/skins/vector/styles-beta.less b/skins/vector/styles-beta.less deleted file mode 100644 index a76b6394b3..0000000000 --- a/skins/vector/styles-beta.less +++ /dev/null @@ -1,13 +0,0 @@ -@import "variables.less"; -@import "beta/variables.less"; - -@media screen { - @import "screen.less"; - @import "beta/screen.less"; - @import "externalLinks.less"; - @import "collapsibleNav.less"; -} - -@media screen and (min-width: 982px) { - @import "screen-hd.less"; -} -- 2.20.1