Project

General

Profile

Actions

Patch #44647

open

Define the monospace font stack as a CSS variable and remove Courier from it

Added by Go MAEDA about 21 hours ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring

Description

The monospace font stack Consolas, Menlo, "Liberation Mono", Courier, monospace, introduced in #20372, is repeated in seven places across application.css, scm.css, wiki_syntax.css and wiki_syntax_detailed.css, and once more in the mailer layout.

The attached patch makes the following changes:

  1. It defines the stack as a CSS variable, --fonts-monospace, next to the existing --fonts-main variable, and uses the variable wherever the stack was repeated. The new value is shown below. The mailer layout keeps a literal value, because some email clients do not support CSS variables.
  2. It removes Courier from the stack. Consolas and Menlo are standard fonts on Windows and macOS, so Courier is only reached on Linux systems without Liberation Mono. Such systems are probably uncommon, as Liberation Mono is commonly installed on desktop Linux. On those systems, the generic monospace family is the better choice, because it resolves to the monospace font chosen by the distribution or the user. On all other systems, the rendered font does not change.
--fonts-monospace: Consolas, Menlo, "Liberation Mono", monospace;

The stack still begins with specific font names rather than the generic monospace alone, so the reduced default font size that browsers apply to a bare monospace does not occur.


Files

No data to display

Actions

Also available in: Atom PDF