Page MenuHomePhabricator

Force the use of a monospaced font for diffs of css/js/scribunto pages regardless of user preference for other kinds of page
Open, Needs TriagePublic

Description

It is easy for the eyes to look at diffs of code pages (CSS/JS/Scribunto/Sanitized-CSS content model) in monospaced font. All code editors by default use monospaced fonts after all. This would be useful across all projects.

While this is simple to achieve with some custom JS, as I suggested at enwiki common.js talk page, TheDJ said that it would be better to apply this via the core software as things that benefit only a small group of users should not require JS on every page of the wiki.

Event Timeline

@SD0001 , At the very least, this should be done with CSS in the page source - not with javascript to insert the styling.

We should always be using mw-editfont-<userpref> for wikitext, which defaults to monospace.

Currently any content type that is handled by CodeEditor (Ace) will override this to monospace, so if when this happens, the diff should force to monospace regardless of user preference.

Filed T250393 for respecting editfont preference. Once that is fixed this task will become much lower priority as we will use wikitext for all diffs except when users have a non-default editfont.

Jdforrester-WMF subscribed.

This clearly didn't block T250393 because we 'Resolved' that one without this.

Jdforrester-WMF renamed this task from Use monospaced font for diffs of css/js/scribunto pages to Force the use of a monospaced font for diffs of css/js/scribunto pages regardless of user preference for other kinds of page.Jul 28 2022, 2:18 PM