diff --git a/includes/Minerva.hooks.php b/includes/Minerva.hooks.php index 554c7498a..0d7f29721 100644 --- a/includes/Minerva.hooks.php +++ b/includes/Minerva.hooks.php @@ -106,7 +106,7 @@ class MinervaHooks { case 'CreateAccount': // FIXME: Note mobile.ajax.styles should not be necessary here. // It's used by the Captcha extension (see T162196) - $out->addModuleStyles( [ 'mobile.ajax.styles', 'skins.minerva.special.userlogin.styles' ] ); + $out->addModuleStyles( [ 'mobile.ajax.styles' ] ); // Add default warning message to Special:UserLogin and Special:UserCreate // if no warning message set. if ( @@ -117,9 +117,6 @@ class MinervaHooks { $request->setVal( 'warning', 'mobile-frontend-generic-login-new' ); } break; - case 'Search': - $out->addModuleStyles( 'skins.minerva.special.search.styles' ); - break; } } } diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index ade588cb1..03a786341 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -267,8 +267,6 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin { if ( $title->isMainPage() ) { $className .= ' page-Main_Page '; - } elseif ( $title->isSpecialPage() ) { - $className .= ' mw-mf-special '; } if ( $this->isAuthenticatedUser() ) { @@ -1379,12 +1377,6 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin { } elseif ( $this->getUserPageHelper()->isUserPage() ) { $styles[] = 'skins.minerva.userpage.styles'; $styles[] = 'skins.minerva.userpage.icons'; - } elseif ( $title->isSpecialPage() ) { - $styles[] = 'mobile.messageBox.styles'; - $styles['special'] = 'skins.minerva.special.styles'; - } - if ( $this->getOutput()->getRequest()->getText( 'oldid' ) ) { - $styles[] = 'mobile.messageBox.styles'; } return $styles; diff --git a/resources/skins.minerva.special.styles/common.less b/resources/skins.minerva.special.styles/common.less deleted file mode 100644 index 5d2d0c7b9..000000000 --- a/resources/skins.minerva.special.styles/common.less +++ /dev/null @@ -1,63 +0,0 @@ -@import 'minerva.variables'; -@import 'minerva.mixins'; - -// FIXME: Apply these styles to all special pages -.mw-mf-special #content { - @verticalPadding: 0.5em; - #section_0 { - padding: @verticalPadding 0; - text-align: center; - font-size: 1.25em; - font-weight: bold; - border: 0; - } - - .pre-content { - padding: 0; - border-bottom: 0; - } -} - -// used in Special:Nearby and Special:UserLogin -.errorbox, -.error { - color: @colorErrorText; - background: @colorErrorBackground; -} - -.mw-mf-special { - h1, - h2 { - font-family: @fontFamily; - } - - .content-header { - padding: 0 0 20px; - border-bottom: 1px solid @colorGray12; - - h2 { - padding: 0; - font-size: 1.1em; - font-weight: bold; - border-bottom: 0; - text-align: center; - } - } - - .content { - // don't apply these styles to headings in message boxes - > h2 { - text-align: center; - margin: 0.7em 0; - font-size: 1.1em; - color: @grayMedium; - } - } - - .error { - h2 { - margin-top: 0; - text-transform: none; - } - } -} diff --git a/resources/skins.minerva.special.styles/forms.less b/resources/skins.minerva.special.styles/forms.less deleted file mode 100644 index 1f3bbf556..000000000 --- a/resources/skins.minerva.special.styles/forms.less +++ /dev/null @@ -1,51 +0,0 @@ -@import 'mediawiki.mixins.less'; -@import 'minerva.variables.less'; -@import 'minerva.mixins.less'; - -form { - // FIXME: work out what to do with these - #mw-prefs-restoreprefs { - display: none; - } - - fieldset { - font-size: 0.9em; - - .htmlform-tip { - display: none; - } - - .mw-label, - .mw-ui-checkbox { - font-style: italic; - font-size: 0.9em; - } - - legend { - color: @grayMedium; - font-size: 0.8em; - font-weight: bold; - text-transform: uppercase; - } - - fieldset { - margin: 0 0 1em 0.3em; - } - } -} - -// For old style forms -// Special:MovePage?target=San%20Francisco -// Special:Import -// Special:NewPages -// Special:RecentChanges -// Special:Prefixindex -// Special:Contributions -// Special:ChangePassword -// Special:ChangeEmail -// Special:Allpages -.mw-input [type='submit'], -.mw-submit { - margin-top: 8px; - min-width: 80%; -} diff --git a/resources/skins.minerva.special.watchlist.scripts/watchlist.js b/resources/skins.minerva.special.watchlist.scripts/watchlist.js deleted file mode 100644 index 0f50f6a69..000000000 --- a/resources/skins.minerva.special.watchlist.scripts/watchlist.js +++ /dev/null @@ -1,31 +0,0 @@ -( function ( M, $ ) { - var WatchList = M.require( 'mobile.watchlist/WatchList' ); - - /** - * Initialises JavaScript on Special:Watchlist - * @method - * @ignore - */ - function init() { - var $watchlist = $( 'ul.page-list' ); - - // FIXME: find more elegant way to not show watchlist stars on recent changes - if ( $( '.mw-mf-watchlist-selector' ).length === 0 ) { - // eslint-disable-next-line no-new - new WatchList( { - api: new mw.Api(), - el: $watchlist, - funnel: 'watchlist', - enhance: true - } ); - $watchlist.find( '.page-summary .info' ).css( 'visibility', 'visible' ); - } - // not needed now we have JS view which has infinite scrolling - $( '.more' ).remove(); - } - - $( function () { - init(); - } ); - -}( mw.mobileFrontend, jQuery ) ); diff --git a/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less b/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less deleted file mode 100644 index dd5fefe15..000000000 --- a/resources/skins.minerva.special.watchlist.styles/specialWatchlist.less +++ /dev/null @@ -1,8 +0,0 @@ -@import 'minerva.variables'; -@import 'minerva.mixins'; - -.client-js { - .page-summary .info { - visibility: hidden; - } -} diff --git a/skin.json b/skin.json index b467031f2..b8c5830b1 100644 --- a/skin.json +++ b/skin.json @@ -36,6 +36,12 @@ }, "ResourceModuleSkinStyles": { "minerva": { + "mediawiki.special.userlogin.common.styles": [ + "skinStyles/mediawiki.special.userlogin.common.styles/minerva.less" + ], + "mediawiki.special.search.styles": [ + "skinStyles/mediawiki.special.search.styles/minerva.less" + ], "mediawiki.skinning.content.parsoid": [], "mediawiki.hlist": [ "skinStyles/mediawiki.hlist/minerva.less" @@ -47,6 +53,12 @@ "skinStyles/mobile.startup/toast.less", "skinStyles/mobile.startup/Overlay.less" ], + "mediawiki.special": [ + "skinStyles/mobile.special.styles/minerva.less" + ], + "mobile.special.styles": [ + "skinStyles/mobile.special.styles/minerva.less" + ], "mobile.toggle": [ "skinStyles/mobile.toggle/minerva.less" ], @@ -243,45 +255,6 @@ "resources/skins.minerva.mainMenu/MainMenu.js" ] }, - "skins.minerva.special.styles": { - "targets": "mobile", - "position": "top", - "styles": [ - "resources/skins.minerva.special.styles/common.less", - "resources/skins.minerva.special.styles/forms.less" - ] - }, - "skins.minerva.special.search.styles": { - "targets": "mobile", - "position": "top", - "styles": [ - "resources/skins.minerva.special.search.styles/search.less" - ] - }, - "skins.minerva.special.watchlist.styles": { - "targets": "mobile", - "position": "top", - "styles": [ - "resources/skins.minerva.special.watchlist.styles/specialWatchlist.less" - ] - }, - "skins.minerva.special.watchlist.scripts": { - "targets": "mobile", - "dependencies": [ - "mobile.startup", - "mobile.watchlist" - ], - "scripts": [ - "resources/skins.minerva.special.watchlist.scripts/watchlist.js" - ] - }, - "skins.minerva.special.userlogin.styles": { - "targets": "mobile", - "position": "top", - "styles": [ - "resources/skins.minerva.special.userlogin.styles/userlogin.less" - ] - }, "skins.minerva.scripts": { "targets": [ "mobile", diff --git a/resources/skins.minerva.special.search.styles/search.less b/skinStyles/mediawiki.special.search.styles/minerva.less similarity index 100% rename from resources/skins.minerva.special.search.styles/search.less rename to skinStyles/mediawiki.special.search.styles/minerva.less diff --git a/resources/skins.minerva.special.userlogin.styles/userlogin.less b/skinStyles/mediawiki.special.userlogin.common.styles/minerva.less similarity index 100% rename from resources/skins.minerva.special.userlogin.styles/userlogin.less rename to skinStyles/mediawiki.special.userlogin.common.styles/minerva.less diff --git a/skinStyles/mobile.special.styles/minerva.less b/skinStyles/mobile.special.styles/minerva.less new file mode 100644 index 000000000..28a2ba165 --- /dev/null +++ b/skinStyles/mobile.special.styles/minerva.less @@ -0,0 +1,25 @@ +@import 'minerva.variables'; + +.ns-special { + #content { + @verticalPadding: 0.5em; + #section_0 { + padding: @verticalPadding 0; + text-align: center; + font-size: 1.25em; + font-weight: bold; + border: 0; + } + + .pre-content { + padding: 0; + border-bottom: 0; + } + } + + h1, + h2 { + // Important given we have no idea which rules special pages are enforcing + font-family: @fontFamily !important; + } +}