jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/359058 )
Change subject: Hygiene: Introduce mobile.variables ...................................................................... Hygiene: Introduce mobile.variables This will allow us to determine which variables to upstream into core and which belong explicitly to Minerva. Changes: * Remove unused m-background-image mixin (thanks Baha!) Change-Id: I612cc2f95f52b249a4ed02a69aca3d9cf6216bb1 --- M includes/Minerva.hooks.php M includes/MobileFrontend.hooks.php M minerva.less/minerva.mixins.less M minerva.less/minerva.variables.less A mobile.less/mobile.mixins.less A mobile.less/mobile.variables.less 6 files changed, 64 insertions(+), 42 deletions(-) Approvals: Pmiazga: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Minerva.hooks.php b/includes/Minerva.hooks.php index 7083002..ab4899e 100644 --- a/includes/Minerva.hooks.php +++ b/includes/Minerva.hooks.php @@ -31,6 +31,19 @@ } /** + * Skin registration callback. + */ + public static function onRegistration() { + // Set LESS importpath + global $wgResourceLoaderLESSImportPaths; + $wgResourceLoaderLESSImportPaths[] = dirname( __DIR__ ) . "/minerva.less/"; + + if ( !ExtensionRegistry::getInstance()->isLoaded( 'MobileFrontend' ) ) { + die( 'This version of the MobileFrontend extension requires MediaWiki 1.25+' ); + } + } + + /** * ResourceLoaderTestModules hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules * diff --git a/includes/MobileFrontend.hooks.php b/includes/MobileFrontend.hooks.php index 9c70e21..aea4b46 100644 --- a/includes/MobileFrontend.hooks.php +++ b/includes/MobileFrontend.hooks.php @@ -1303,6 +1303,7 @@ */ public static function onRegistration() { global $wgResourceLoaderLESSImportPaths, $wgDisableAuthManager; + $wgResourceLoaderLESSImportPaths[] = dirname( __DIR__ ) . "/mobile.less/"; // modify login/registration form if ( class_exists( AuthManager::class ) && !$wgDisableAuthManager ) { @@ -1312,8 +1313,9 @@ Hooks::register( 'UserCreateForm', 'MobileFrontendHooks::onUserCreateForm' ); } - // Set LESS importpath - $wgResourceLoaderLESSImportPaths[] = dirname( __DIR__ ) . "/minerva.less/"; + if ( class_exists( 'MinervaHooks' ) ) { + MinervaHooks::onRegistration(); + } } /** diff --git a/minerva.less/minerva.mixins.less b/minerva.less/minerva.mixins.less index 4e41da1..aae771e 100644 --- a/minerva.less/minerva.mixins.less +++ b/minerva.less/minerva.mixins.less @@ -1,16 +1,6 @@ @import 'mediawiki.mixins.less'; @import 'mediawiki.mixins.animation.less'; -// FIXME: This mixin should not be necessary and only exists because of -// https://phabricator.wikimedia.org/T142532 -// Please do not use it. -.m-background-image( @url ) { - &:after, - &:before { - .background-image( @url ); - } -} - // Generic mixin for applying styles to text that accompanies/adds context to workflows .secondary-text() { font-size: 0.9em; diff --git a/minerva.less/minerva.variables.less b/minerva.less/minerva.variables.less index d39c222..cbe1091 100644 --- a/minerva.less/minerva.variables.less +++ b/minerva.less/minerva.variables.less @@ -1,4 +1,6 @@ @import 'mediawiki.ui/variables'; +// FIXME: Remove this dependency. Should not depend on mobile.variables +@import 'mobile.variables.less'; @skinContentBgColor: #fff; @@ -28,20 +30,11 @@ @titleSectionSpacingTop: 20px; @titleSectionSpacingBottom: 25px; -@grayDark: @colorGray2; -@grayMediumDark: @colorGray5; -@grayMedium: @colorGray7; -@grayMediumLight: @colorGray10; -@grayLight: @colorGray12; -@grayLightest: @colorGray14; - // colors @chromeColor: @grayLightest; @chromeContentSeparator: @colorGray13; @semiTransparent: rgba( 0, 0, 0, 0.8 ); -// note this is also used for red links -@redBase: @colorErrorText; -@colorTutorial: #2e76ff; + @linkColor: #002bb8; @lastModifiedBarActiveBackgroundColor: #00af89; @toastNotificationColor: @colorGray2; @@ -53,23 +46,17 @@ @colorWarningBackground: #feb; @colorWarningBorder: #fde29b; @colorWarningText: #850; -@colorSuccessBackground: #e1fddf; @colorSuccessBorder: #b7fdb5; -@colorSuccessText: #009000; @colorErrorBackground: #fae3e3; @colorErrorBorder: #fac5c5; // typography -@fontFamily: 'Helvetica Neue', 'Helvetica', 'Nimbus Sans L', 'Arial', 'Liberation Sans', sans-serif; @fontFamilyHeading: 'Linux Libertine', 'Georgia', 'Times', serif; @fontScalingFactor: 1; @contentLineHeight: 1.65; @headingMargin: 0.5em; @sectionIconWidth: 30px; - -// information messages, e.g. empty watchlist message -@infoColor: @colorGray7; // blockquotes @blockquotePaddingRight: 25px; @@ -78,9 +65,6 @@ // custom tablet styling @contentPaddingTablet: 3.35em; -// FIXME: To be moved to includes/Config in a follow up patch. -@wgMFDeviceWidthDesktop: 62.5em; // 1000px / 16 px; - // note since content does not use view border box we have to include padding. @contentMaxWidthTablet: @wgMFDeviceWidthDesktop - ( 2 * @contentPaddingTablet ); @contentTopPadding: 1.6em; @@ -88,17 +72,6 @@ // Wiki specific variables @infoboxWidth: 320px; -// OOJs specific icon variables -@baseIconSize: 24px; -@targetIconSize: 32px; - -// z-index definitions (see bug 64707) -@z-indexBase: 0; -@z-indexOverlay: 1; -@z-indexOverOverlay: 2; - -// table of contents -@tocFontSize: 0.8em; // indicators @indicatorFontSize: 0.4em; diff --git a/mobile.less/mobile.mixins.less b/mobile.less/mobile.mixins.less new file mode 100644 index 0000000..d81c91d --- /dev/null +++ b/mobile.less/mobile.mixins.less @@ -0,0 +1,4 @@ +@import 'mediawiki.mixins.animation'; +@import 'mediawiki.mixins.less'; + +// FIXME: Do not add anything to this file. It is temporary until all usages have been removed. \ No newline at end of file diff --git a/mobile.less/mobile.variables.less b/mobile.less/mobile.variables.less new file mode 100644 index 0000000..d55f787 --- /dev/null +++ b/mobile.less/mobile.variables.less @@ -0,0 +1,40 @@ +/* GOAL: Upstream all these variables to core */ +@import 'mediawiki.ui/variables'; + +// z-index definitions (see bug 64707) +@z-indexBase: 0; +@z-indexOverlay: 1; +@z-indexOverOverlay: 2; + +@fontFamily: 'Helvetica Neue', 'Helvetica', 'Nimbus Sans L', 'Arial', 'Liberation Sans', sans-serif; + +// OOJs specific icon variables +@baseIconSize: 24px; +@targetIconSize: 32px; + +// FIXME: This is very minerva specific but used by mobile.toc +@tocFontSize: 0.8em; + +// ==== Colors +// Gray Colors +@grayDark: @colorGray2; +@grayMediumDark: @colorGray5; +@grayMedium: @colorGray7; +@grayMediumLight: @colorGray10; +@grayLight: @colorGray12; +@grayLightest: @colorGray14; + +// note this is also used for red links +@redBase: @colorErrorText; +// information messages, e.g. empty watchlist message +@infoColor: @colorGray7; +// background color for help screens/tutorials +@colorTutorial: #2e76ff; + +// TODO: Can these be made to use core variables (or swapped out for some)? +@colorSuccessBackground: #e1fddf; +@colorSuccessText: #009000; + +// FIXME: To be moved to includes/Config in a follow up patch. +@wgMFDeviceWidthDesktop: 62.5em; // 1000px / 16 px; + -- To view, visit https://gerrit.wikimedia.org/r/359058 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I612cc2f95f52b249a4ed02a69aca3d9cf6216bb1 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Pmiazga <pmia...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits