Kaldari has uploaded a new change for review. https://gerrit.wikimedia.org/r/99771
Change subject: HYGIENE: Deprecating @baseFontSize ...................................................................... HYGIENE: Deprecating @baseFontSize We are reinventing the wheel here. The unit 1em means the browser's base font size (as set in the preferences). So 2em is just a multiplier on that. There is no reason for us to duplicate this logic by redeclaring our own baseFontSize that is also 1em and multiplying everything by that. In essence we are reimplementing the functionality of the em unit. And if we do actually want to change all of our font sizes, we would adjust @fontScalingFactor anyway, not @baseFontSize. In converting our own multiplier to ems, I rounded to the nearest tenth in some cases, which should have negligible impact. The only exception to this is bodyLineHeight which I converted to a pure multiplier (which is better to use for a default line-height due to inheritance), and rounded up instead of down since 1.3 is a rather cramped line-height and most of our text is set to much larger line-height values anyway (1.5 or 1.65) Change-Id: Ib9864ba6c951cf3a30bd45c8bbb5aa7d36ab8d4a --- M less/common/footer.less M less/common/typography.less M less/common/ui.less M less/desktop/mobileBridge.less M less/specials/search.less M less/variables.less 6 files changed, 11 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/71/99771/1 diff --git a/less/common/footer.less b/less/common/footer.less index db78699..ea6777d 100644 --- a/less/common/footer.less +++ b/less/common/footer.less @@ -13,7 +13,7 @@ h2 { display: inline; font-weight: bold; - font-size: @baseFontSize; + font-size: 1em; img { height: 1em; diff --git a/less/common/typography.less b/less/common/typography.less index f91ceb9..b58c4f7 100644 --- a/less/common/typography.less +++ b/less/common/typography.less @@ -3,10 +3,10 @@ html { /* prevent font scaling in landscape in Safari */ -webkit-text-size-adjust: none; - font-size: 100% * @fontScalingFactor; /* default browser size is 16px (12pt - our @baseFontSize) */ + font-size: 100% * @fontScalingFactor; /* default browser size is 16px (12pt) */ } -@bodyLineHeight: ( @baseFontSize / 3 ) * 4; /* = 16pt */ +@bodyLineHeight: 1.4; @headingLineHeight: 1.3; body { @@ -64,15 +64,15 @@ } h1 { - font-size: @baseFontSize * 1.833; + font-size: 1.8em; } h2 { - font-size: ( @baseFontSize / 2 ) * 3; /* 18pt */ + font-size: 1.5em; } h3 { - font-size: ( @baseFontSize / 6 ) * 7; /* 14pt */ + font-size: 1.2em; font-weight: bold; } @@ -90,7 +90,7 @@ sub, sup { - font-size: ( 3 * @baseFontSize / 4 ); + font-size: 0.75em; } @media all and (max-width: @wgMFDeviceWidthMobileSmall) { diff --git a/less/common/ui.less b/less/common/ui.less index ed3e6c1..a873d17 100644 --- a/less/common/ui.less +++ b/less/common/ui.less @@ -37,7 +37,7 @@ padding: 2px @searchBarPaddingLeft 0 @searchBarPaddingLeft; h1, h2 { - font-size: @baseFontSize * 1.6; + font-size: 1.6em; } } diff --git a/less/desktop/mobileBridge.less b/less/desktop/mobileBridge.less index ce6710a..661baa8 100644 --- a/less/desktop/mobileBridge.less +++ b/less/desktop/mobileBridge.less @@ -25,7 +25,7 @@ padding: 2px 10px 0 @searchBarPaddingLeft; h2 { - font-size: @baseFontSize * 1.6; + font-size: 1.6em; border: none; } diff --git a/less/specials/search.less b/less/specials/search.less index 4f66c26..b8373ff 100644 --- a/less/specials/search.less +++ b/less/specials/search.less @@ -6,14 +6,14 @@ font-weight: bold; } .mw-search-result-data { - font-size: @baseFontSize * 0.7; + font-size: 0.7em; font-style: italic; color: #535353; margin-left: 12px; } div.searchresult { - font-size: @baseFontSize * 0.9; + font-size: 0.9em; width: 100%; margin-left: 12px; } diff --git a/less/variables.less b/less/variables.less index dec1284..ae4650c 100644 --- a/less/variables.less +++ b/less/variables.less @@ -39,8 +39,6 @@ @fontFamily: "Helvetica Neue", "Helvetica", "Nimbus Sans L", "Arial", "Liberation Sans", sans-serif; @fontFamilyHeading: Georgia, serif; @fontScalingFactor: 0.9; -// FIXME: Deprecate use of @baseFontSize; -@baseFontSize: 1em; @headingMargin: .5em; @sectionBorderColor: #E2E3E4; @sectionIconWidth: 30px; -- To view, visit https://gerrit.wikimedia.org/r/99771 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9864ba6c951cf3a30bd45c8bbb5aa7d36ab8d4a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Kaldari <rkald...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits