Generic parent-task: T245476: [SPIKE] How to make source editors' font-size responsive
Compared to the article font-size of 15.2px editor text is too small to provide a convenient UX.
Steps to Reproduce:
- Compare text in the editor to sidebar links, latter is the same as article text.
- Compare text in the editor with highlighting turned on and off.
- Do these with all 3 of the editor font settings: monospace, sans-serif, serif.
WTE / WTE2010:
WTE2017:
- Enable "New wikitext mode"
- https://www.mediawiki.org/wiki/2017_wikitext_editor?veaction=editsource&useskin=timeless
Reason
For historical reasons related to browsers implicitly setting monospace elements' font-size to something around 13px (inconsistently, ofc):
T182320: Fix textarea editor's edit font size sets the font-size to 13px for all skins, all editors, also when using non-monospace font.
Not an issue (not noticeable) in Vector (body: 14px), MonoBook (12.7px), Modern (13px).
Minerva avoids this by resetting paragraphs' (not the editor's) font-size to 16px.
Fix
Reset (inherit) default page font-size in editors (in Timeless).
Screenshots
Bad vs Good:
Before and after fix:
QA
Test on beta-cluster
WTE2010 source editor
- Set the Skin to Timeless if not done yet.
- Open "Editing" tab in "Preferences" in a new browser tab for efficency.
- Choose all 3 "Edit area font style" options, reload the editor with each option, check the "font-" CSS rules in DevTools.
- For each option, enable "Syntax highlighting" on the toolbar (stylus icon left of "Advanced", forces monospace font).
- Evaluate whether the font size is visually perceived as similar with syntax highlighting enabled and disabled (subjective measure).
- With highlighting enabled check the "font-" CSS rules in DevTools (only necessary once).
sans | serif | mono | highlighting (mono) | |
15.2px | 15.2px | 13.56px | 13.56px | expected font-size: (with 16px browser setting) |
15.2px ✔️ | 15.2px ✔️ | 15.2px ➖ | 15.2px ➖ | actual font-size: |
✔️ | ✔️ | ✔️ | ➖ | font-family: as defined |
WTE2017 VE source editor (NWE)
- Enable "New wikitext mode" in "Beta features" tab.
- Open "Editing" tab in "Preferences" in a new browser tab for efficency.
- Choose all 3 "Edit area font style" options, reload the editor with each option, check the "font-" CSS rules in DevTools.
- For each option, enable "Syntax highlighting" in the hamburger menu (forces monospace font).
- Evaluate whether the font size is visually perceived as similar with syntax highlighting enabled and disabled (subjective measure).
- With highlighting enabled check the "font-" CSS rules in DevTools (only necessary once).
sans | serif | mono | highlighting (mono) | |
15.2px | 15.2px | 13.56px | 13.56px | expected font-size: (with 16px browser setting) |
13px ➖ | 13px ➖ | 13px ➖ | 13px ➖ | actual font-size: 15.2px (with 16px browser setting) |
➖ | ➖ | ➖ | ➖ | font-family: as defined |