modernist icon indicating copy to clipboard operation
modernist copied to clipboard

Add "monospace" as a fallback font for pre and code

Open benblank opened this issue 2 years ago • 1 comments

Currently, if a client doesn't have any of the fonts listed for code, pre available on their system, it uses the browser's default font, which is typically a variable-width font. Unfortunately, this looks terrible.

For example, here is a relevant portion of the demo page viewed under Chrome 103 on my laptop running Lubuntu 22.04, which has none of the specified fonts:

Before: pre section using variable-width font

This PR adds monospace as a final option, which will at least allow browsers to select an available monospace font for those elements. Here is the same section, on the same browser and laptop, after the change:

After: pre section using monospace font

benblank avatar Jul 03 '22 04:07 benblank

Welcome! Congrats on your first pull request to the Modernist theme. If you haven't already, please be sure to check out the contributing guidelines.

welcome[bot] avatar Jul 03 '22 04:07 welcome[bot]