Make WordPress Core

Opened 12 months ago

Last modified 12 months ago

#63852 new enhancement

Twenty Twenty-Five: Code block does not use fallback to default monospace font

Reported by: climatesaver Owned by:
Priority: normal Milestone: Awaiting Review
Component: Bundled Theme Version: 6.7
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

In Appearance – Editor – Styles – Typography – Manage fonts I deactivated all fonts. I want my blog to be simple and don’t want to increase its size by using custom fonts. Now the site uses the default browser’s font and I’m happy with that.

Except that Code blocks are not using the browser’s default monospace font but instead are in the same font as the other text on the website. Code blocks should always fall back to use the Monospace font family.

Attachments (1)

63852.diff (543 bytes ) - added by sabernhardt 12 months ago.

Download all attachments as: .zip

Change History (2)

@sabernhardt
12 months ago

#1 @sabernhardt
12 months ago

  • Keywords has-patch added
  • Summary Code block does not use fall back to default Monospace font with TwentyTwentyFive themeTwenty Twenty-Five: Code block does not use fallback to default monospace font
  • Type defect (bug)enhancement
  • Version 6.8.26.7

I switched this to an enhancement because PR 141 indicated a preference for Fira Code instead of a monospace system font.

The patch worked for me in trunk and with WordPress 6.7, adding monospace inside the var().
font-family: var(--wp--preset--font-family--fira-code, monospace);

Note: See TracTickets for help on using tickets.