Last modified: 2014-11-15 04:13:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72028, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70028 - Should Mediawiki UI change font-family for textareas?
Should Mediawiki UI change font-family for textareas?
Status: NEW
Product: MediaWiki
Classification: Unclassified
MediaWiki UI (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://mwui.wmflabs.org/w/index.php?t...
:
Depends on:
Blocks: 70424
  Show dependency treegraph
 
Reported: 2014-08-26 09:43 UTC by Michael M.
Modified: 2014-11-15 04:13 UTC (History)
11 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Michael M. 2014-08-26 09:43:13 UTC
The edit box on http://mwui.wmflabs.org/w/index.php?title=Main_Page&action=edit uses a proportional font, while the default for the user setting "Edit area font style" is "Browser default", which is a monospace font.

I did not test this as logged in user, but
.mw-ui-input {
 font-family: inherit;
}

is more specific than the style generated by [1] and thus likely to override even explicit user preferences for the font style.

[1] https://git.wikimedia.org/blob/mediawiki%2Fcore.git/9665a657b005f3a5b882efff3dd5faeba73297d2/includes%2Fresourceloader%2FResourceLoaderUserCSSPrefsModule.php#L77
Comment 1 Bartosz Dziewoński 2014-08-26 12:34:16 UTC
I think .mw-ui-input just shouldn't be applied to <textarea>s. Jon disagreed with me last time I brought it up, though.
Comment 2 Jon 2014-08-26 19:29:53 UTC
I'm agnostic about which font to use in textareas / inputs or whether mw-ui-input should be applied solely to input elements and not text areas.

This is how we are currently using it in projects like Flow though, so it is good to be consistent.

Adding design for rationale and whether they want to rethink it in terms of Flow/elsewhere.
Comment 3 Michael M. 2014-08-27 09:38:52 UTC
I actually like the .mw-ui-input style for <textarea>s, as you can easily recognize where the focus is. I don't know how many times I tried to select/paste/... text, and it failed because I didn't notice that the focus was somewhere else. It's just the font-family I don't like (and this is probably just because I'm used to that monospace font). But as bug 53734 was considered as major bug, and had 3 duplicates, I don't seem to be the only one who prefers monospace font for the edit box.
Comment 4 Derk-Jan Hartman 2014-08-27 09:44:33 UTC
past experience shows that people are all but agnostic about font type on the wikieditor screen :)
Comment 5 Bartosz Dziewoński 2014-08-27 21:12:52 UTC
I think using a monospace font is pretty important for "wikitext" textareas. Trying to place the cursor next to a '[' or, even worse, a '|', in a proportional font can be very annoying. It matters a lot less for "text" textareas (such as the Flow ones mentioned earlier, I guess, although they also accept wikitext input), since there tends to be fewer weirdly-sized characters in them.

Proportional font for the entire body text is also definitely problematic when editing a computer-science-related article with code samples, for obvious reasons. On the other hand, editing a liberal-arts-related article with a monospace font is a minor annoyance at worst. ;)
Comment 6 Jared Zimmerman (WMF) 2014-08-28 22:47:41 UTC
Bartosz, its a good point, I've changed the bug description to be more neutral until me make a decision on this.
Comment 7 Michael M. 2014-08-29 10:10:48 UTC
Templates in wikitext are often formated with spaces to align the =-signs (for example [[de:Special:Upload]]). This doesn't work with proportional fonts. But for textboxes that don't take wikitext (at least not as the primary input), I think it is ok to switch to sans-serif (or whatever font is inherited).
Comment 8 Matthew Flaschen 2014-09-05 00:07:40 UTC
(In reply to Michael M. from comment #0)
> I did not test this as logged in user, but
> .mw-ui-input {
>  font-family: inherit;
> }
> 
> is more specific than the style generated by [1] and thus likely to override
> even explicit user preferences for the font style.

This is tested.  You are correct.  The user preference ("Edit area font style") is applied to all textarea elements (textarea {} ), although that does not really match the description.  Element selectors have lower specificity than class selectors (.mw-ui-input {} ).

We do not need to apply it to all textareas (that is not what the preference says).

However, we do need to either respect the preference for the main wikitext editing area, or remove the preference.

I suggest we make a .mw-ui-input-wikitext-page secondary class, that respects this preference.  It should apply when you're editing a wikitext page (including section editing).

The 'page' distinction is under the theory that Flow will want its own class (without inheriting this font behavior), which may be justifiable considering it's a very different use case (messages with few if any templates as opposed to long pages or sections with templates sprinkled throughout).
Comment 9 Michael M. 2014-09-05 08:25:22 UTC
(In reply to Matthew Flaschen from comment #8)
> I suggest we make a .mw-ui-input-wikitext-page secondary class, that
> respects this preference.  It should apply when you're editing a wikitext
> page (including section editing).

Actually, there should also be classes .mw-ui-input-javascript, .mw-ui-input-css, etc. which always use monospace. I don't think that users who change their settings to use a proportional font actually want this to apply to JS/CSS-code, too.
Comment 11 Matthew Flaschen 2014-11-13 22:34:18 UTC
(In reply to Helder from comment #10)
> See also
> https://pt.wikipedia.org/wiki/WP:Café_dos_programadores#caixa_de_edi.C3.A7.
> C3.A3o

It sounds like it may have been caused by a gadget depending on mediawiki.ui.input.  When logged out (implying only default gadgets and preferences), https://pt.wikipedia.org/wiki/Special:Random?action=edit does not show the mw-ui-input styles yet (e.g. blue bar, etc.)

One of the notes there said something about the font size decreasing for them (maybe because the family is different), which is relevant if/when we look at turning this on more widely.
Comment 12 Helder 2014-11-13 22:39:30 UTC
(In reply to Matthew Flaschen from comment #11)

The users affected in that were using this gadget
https://pt.wikipedia.org/wiki/Special:PrefixIndex/MediaWiki:Gadget-fastbuttons
which had a dependency on "mediawiki.ui.input":
https://pt.wikipedia.org/w/index.php?diff=40487124

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links