Make WordPress Core

Opened 45 hours ago

Last modified 17 hours ago

#63852 new enhancement

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

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

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 17 hours ago.

Download all attachments as: .zip

Change History (2)

@sabernhardt
17 hours ago

#1 @sabernhardt
17 hours ago

  • Keywords has-patch added
  • Summary changed from Code block does not use fall back to default Monospace font with TwentyTwentyFive theme to Twenty Twenty-Five: Code block does not use fallback to default monospace font
  • Type changed from defect (bug) to enhancement
  • Version changed from 6.8.2 to 6.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.