From f4400ec5c95a9c27706c5973fadf14c7c2e804ff Mon Sep 17 00:00:00 2001 From: Baha Date: Fri, 19 Feb 2016 15:55:59 -0500 Subject: [PATCH] Fix RelatedPages placement in Monobook * Load skin specific styles only in that skin; * Vector styles are default for all skins unless overwritten; * Allow monobook styles to inherit from vector styles; * Do not load visual editor related rules in minerva; * Remove an unused CSS rule. Bug: T126149 Change-Id: I1e657de7a45fb4812c42ca7b99624b585dc4b7dd --- includes/FooterHooks.php | 8 ++++++ .../readMore.default.less | 15 +++++++++++ .../readMore.less | 25 ------------------- .../readMore.minerva.less | 7 ++++++ .../readMore.monobook.less | 6 +++++ 5 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 resources/ext.relatedArticles.readMore/readMore.default.less create mode 100644 resources/ext.relatedArticles.readMore/readMore.minerva.less create mode 100644 resources/ext.relatedArticles.readMore/readMore.monobook.less diff --git a/includes/FooterHooks.php b/includes/FooterHooks.php index e0d76502..c28f185d 100644 --- a/includes/FooterHooks.php +++ b/includes/FooterHooks.php @@ -142,6 +142,14 @@ class FooterHooks { "styles" => array( "resources/ext.relatedArticles.readMore/readMore.less" ), + "skinStyles" => array( + "default" => "resources/ext.relatedArticles.readMore/readMore.default.less", + "monobook" => array( + "resources/ext.relatedArticles.readMore/readMore.default.less", + "resources/ext.relatedArticles.readMore/readMore.monobook.less" + ), + "minerva" => "resources/ext.relatedArticles.readMore/readMore.minerva.less" + ), "messages" => array( "relatedarticles-read-more-heading" ), diff --git a/resources/ext.relatedArticles.readMore/readMore.default.less b/resources/ext.relatedArticles.readMore/readMore.default.less new file mode 100644 index 00000000..795723ef --- /dev/null +++ b/resources/ext.relatedArticles.readMore/readMore.default.less @@ -0,0 +1,15 @@ +// Hide RelatedArticles when VE is activated (https://phabricator.wikimedia.org/T120443) +.ve-activated { + .ra-read-more { + display: none; + } +} + +.ra-read-more { + margin: 0 0 0 10em; + padding: 1em; + + .ext-cards-card-list { + margin-left: 0; + } +} diff --git a/resources/ext.relatedArticles.readMore/readMore.less b/resources/ext.relatedArticles.readMore/readMore.less index d07d0f6b..7f613eb6 100644 --- a/resources/ext.relatedArticles.readMore/readMore.less +++ b/resources/ext.relatedArticles.readMore/readMore.less @@ -1,16 +1,6 @@ @import "mediawiki.ui/variables"; -// Hide RelatedArticles when VE is activated (https://phabricator.wikimedia.org/T120443) -.ve-activated { - .ra-read-more { - display: none; - } -} - .ra-read-more { - margin-top: 35px; - margin-bottom: 70px; - h2 { border-bottom: none; font-size: .8em; @@ -20,19 +10,4 @@ text-transform: uppercase; letter-spacing: 1px; } - - .page-list { - border-top: 1px solid @colorGray14; - } -} - -body.skin-vector { - .ra-read-more { - margin: 0 0 0 10em; - padding: 1em; - - .ext-cards-card-list { - margin-left: 0; - } - } } diff --git a/resources/ext.relatedArticles.readMore/readMore.minerva.less b/resources/ext.relatedArticles.readMore/readMore.minerva.less new file mode 100644 index 00000000..9c77aab7 --- /dev/null +++ b/resources/ext.relatedArticles.readMore/readMore.minerva.less @@ -0,0 +1,7 @@ +@import "mediawiki.ui/variables"; + +.ra-read-more { + margin-top: 35px; + margin-bottom: 70px; +} + diff --git a/resources/ext.relatedArticles.readMore/readMore.monobook.less b/resources/ext.relatedArticles.readMore/readMore.monobook.less new file mode 100644 index 00000000..59e0a032 --- /dev/null +++ b/resources/ext.relatedArticles.readMore/readMore.monobook.less @@ -0,0 +1,6 @@ +// inherits from vector styles + +.ra-read-more { + margin: 0 0 0 12.2em; + padding: 1em 0; +}