Actions
Patch #44647
openDefine the monospace font stack as a CSS variable and remove Courier from it
Status:
New
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
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:
- It defines the stack as a CSS variable,
--fonts-monospace, next to the existing--fonts-mainvariable, 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. - It removes
Courierfrom 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 genericmonospacefamily 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