From d228b2cbd7b58651f988c455c6db9147dd901c9a Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Tue, 12 Dec 2017 17:35:54 -0800 Subject: [PATCH] multi-line, two-line and mw-ui-button-group only loaded where needed The only usage of mw-ui-button is inside the SpecialMobileWatchList class in MobileFrontend. Thus we needlessly load as a render blocking CSS on all page views multi-line and two-line are likewise only used inside MobileSpecialPageFeed.php mobile.special.styles is loaded on all Special pages so let's load this instead here. This also allows us to use the element on other special pages in future. Change-Id: I2b363543d0356a18194a9d08922428a6cb944797 --- resources/skins.minerva.base.styles/ui.less | 27 ---------------- skinStyles/mobile.special.styles/minerva.less | 31 +++++++++++++++++++ 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/resources/skins.minerva.base.styles/ui.less b/resources/skins.minerva.base.styles/ui.less index 1fbcec7..14c84c2 100644 --- a/resources/skins.minerva.base.styles/ui.less +++ b/resources/skins.minerva.base.styles/ui.less @@ -290,19 +290,6 @@ input.search { overflow: hidden; -webkit-text-overflow: ellipsis; text-overflow: ellipsis; - - // FIXME: this works only in WebKit - &.multi-line { - white-space: normal; - display: -webkit-box; - -webkit-box-orient: vertical; - } - - &.two-line { - -webkit-line-clamp: 2; - // fallback for non-WebKit - max-height: 2.6em; - } } // FIXME: Create generic class to represent both of these headers @@ -385,20 +372,6 @@ input.search { } } -// FIXME [mediawiki ui] These rules should not be needed in the mobile context -.mw-ui-button-group { - text-align: center; - - * { - float: none !important; - } - - // For talk and CTA drawer - .mw-ui-block { - width: auto; - } -} - // This is here rather than in mainmenu.less because we want to load these rules for non-js users too // Transparent shield hidden by default .transparent-shield, diff --git a/skinStyles/mobile.special.styles/minerva.less b/skinStyles/mobile.special.styles/minerva.less index 1e945b3..38f9d2f 100644 --- a/skinStyles/mobile.special.styles/minerva.less +++ b/skinStyles/mobile.special.styles/minerva.less @@ -1,5 +1,19 @@ @import 'minerva.variables'; +// FIXME [mediawiki ui] These rules should not be needed in the mobile context +.mw-ui-button-group { + text-align: center; + + * { + float: none !important; + } + + // For talk and CTA drawer + .mw-ui-block { + width: auto; + } +} + .ns-special { #content { #section_0 { @@ -31,3 +45,20 @@ } } } + +// Used by MobileSpecialPageFeed.php in MobileFrontend +.truncated-text { + + // FIXME: this works only in WebKit + &.multi-line { + white-space: normal; + display: -webkit-box; + -webkit-box-orient: vertical; + } + + &.two-line { + -webkit-line-clamp: 2; + // fallback for non-WebKit + max-height: 2.6em; + } +}