From a9d8f63abb5f1799588746b9d48087cd8a1d63a7 Mon Sep 17 00:00:00 2001 From: Isarra Date: Mon, 6 Apr 2020 19:30:28 +0000 Subject: [PATCH] Make wikitext editor use fonts consistent with rest of content Monospace, serif, and sans-serif font stacks should all have consistent metrics, so actually use them in wikitext editor. (Which depends on user preferences.) Also reset core font sizes added per T182320; that was done for skins using system fonts elsewhere as well, and thus isn't really relevant here. Also define out sans and serif font family variables independent of main stack variables so they won't accidentally get overridden to other things, but not presently following new naming conventions because frankly I don't understand them and don't know which I should be using to begin with. And even if I did, they're extremely long and we're already exceeding maximum line length guidelines... Bug: T247325 Change-Id: Iab98cfacab7dbc2f752bd200ee82d6d1a58c19a6 --- resources/forms.less | 20 ++++++++++++++++++++ resources/themes/wikimedia.less | 7 +++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/resources/forms.less b/resources/forms.less index eafed76..8959cce 100644 --- a/resources/forms.less +++ b/resources/forms.less @@ -54,6 +54,26 @@ div.editOptions { } } +// Essentially revert T182320 (core change) +// Custom font stacks below should fully address this issue regardless +.mw-editfont-monospace, +.mw-editfont-sans-serif, +.mw-editfont-serif { + font-size: inherit; +} + +.mw-editfont-monospace { + font-family: @fonts-mono; +} + +.mw-editfont-sans-serif { + font-family: @fonts-sans; +} + +.mw-editfont-serif { + font-family: @fonts-serif; +} + /* Extension:TemplateSandbox stuff */ .mw-templatesandbox-page label { padding: 0; diff --git a/resources/themes/wikimedia.less b/resources/themes/wikimedia.less index ddb3f92..5dec1dc 100644 --- a/resources/themes/wikimedia.less +++ b/resources/themes/wikimedia.less @@ -32,9 +32,12 @@ // Flair // Fonts are chosen for consistent metrics, not necessarily overall prettiness. -@fonts: 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Lato', 'Liberation Sans', 'Noto Sans', 'Helvetica Neue', 'Helvetica', sans-serif; -@fonts-secondary: 'Linux Libertine', 'Times New Roman', 'Liberation Serif', 'Nimbus Roman', 'Noto Serif', 'Times', serif; +@fonts-sans: 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Lato', 'Liberation Sans', 'Noto Sans', 'Helvetica Neue', 'Helvetica', sans-serif; +@fonts-serif: 'Linux Libertine', 'Times New Roman', 'Liberation Serif', 'Nimbus Roman', 'Noto Serif', 'Times', serif; @fonts-mono: 'Menlo', 'Consolas', 'Monaco', 'Noto Mono', 'Nimbus Mono L', monospace; +@fonts: @fonts-sans; +@fonts-secondary: @fonts-serif; + @border: 0.2em; @radius: 0.2em;