The font size is tiny in the code editor. Much smaller than in the regular source editor, even when just toggling back and forth between them in the editor itself without reloading anything. How can this be changed, either per-user or sitewide?
Topic on Extension talk:CodeEditor
A hack that I used at one time:
$('.ace_editor').css('font-size', '0.875rem');
This sounds like a bug or broken user script/gadget in your account? If you go in an incognito browser window to https://www.mediawiki.org/w/index.php?title=MediaWiki:Mainpage&action=edit&safemode=1 (2010 wikitext editor, aka the "regular source editor") and compare it with https://www.mediawiki.org/w/index.php?title=MediaWiki:Common.css&action=edit&safemode=1 (CodeEditor) the font sizes are identical for me in Chrome, Firefox, and Safari.
Do you have the same problem if you enable 'safemode' (?safemode=1
), which loads the page without your gadgets and scripts?
The text at both of those links and in the textbox I am typing in right now are all very tiny. None of them are what I see when I edit a page normally, say Extension:Buggy (where I get the font size I'm used to). And when I remove the "&safemode=1" from the end of the first URL, I see normal size text. (Removing "&safemode=1" from the second URL has no effect [text still tiny], because that is using the Code Editor.)
When I edit Extension:Buggy in safemode, I see the tiny text. Changing my browser font settings for monospace doesn't have any effect.
The only relevant gadget I have enabled is:
- [checked] Remove VisualEditor from the user interface
Relevant preferences:
- [checked] Enable the editing toolbar / This is sometimes called the '2010 wikitext editor'.
- [unchecked] Enable the visual editor
- [unchecked] Use the wikitext mode inside the visual editor, instead of a different wikitext editor / This is sometimes called the '2017 wikitext editor'.
- [checked] Enable syntax highlighting for wikitext
No user CSS or JS. I'm using the default skin, Vector (2022).
No matter what combination of the preferences and gadget I mentioned above that I try, I can't get the tiny text I see in the Code Editor.
I originally came here to report this based on my experience with a largely out-of-the-box MediaWiki installation (meaning, very few configuration changes, and none that should have any effect on this discussion) that I've been using for my own purposes for 4 years now. I just tried the Code Editor for the first time (in MW 1.41.1), and saw the tiny text for the first time. (Although, like I said, I am seeing it here in the textbox I am typing in right now).
I will point out, BTW, that as the page is loading at the 2 "safemode" URLs, I see normal sized text in the textbox, then when the editor actually finishes loading, it's the smaller size.
I remembered that I have a global.css
at Meta, which explains why I was seeing the normal-size text (for me, this means 18pt) in the regular source editor (outside of safemode). Without that, I see the tiny text there, too. (Now I recall that this is why I created the global.css
in the first place, back in Jan 2018.) I also have the same settings in a site-wide vector.css
on my own wiki I mentioned previously. (I had forgotten about that, too, since I did that in 2020.)
I have not been able to find a way to override the font size in the Code Editor, so my original question still stands. (For the record, I have tried changing the monospace font settings on my desktop — i.e., at an even lower level than my browser — and that had no effect with respect to what we're talking about here.)
A font-size option in the editor itself (i.e., via the regular UI) would be very much appreciated (in all of the editors, in fact). I can't possibly be the only person this is an issue for. It's kind of amazing this hasn't already happened, actually. It seems like a pretty obvious accessibility thing (its necessity, I mean, not how to implement it).
The accessibility feature is built into your browser; you should use that, not hacks in global.css or other innovative ways to break the software. :-)
I assume you're talking about magnifying everything in the window (Ctrl-+). So, to get a reasonable size in the editor you're suggesting that have I have huge text everywhere else? Sorry, but that's a non-starter. What should be happening instead is, the Code Editor should give users a mechanism for setting the font size that they're looking at. That is good UI design. What exists currently is, frankly, absolute shit.