Make WordPress Core

#56396 closed defect (bug) (fixed)

Twenty Twenty: update selectors in get_non_latin_css()

Reported by: sabernhardt's profile sabernhardt Owned by: audrasjb's profile audrasjb
Milestone: 6.1 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch has-screenshots commit
Focuses: css Cc:


Several of the selectors used to set fonts are missing from the 'front-end' array:

.entry-content .wp-block-cover-image p,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.entry-content table,
.entry-content address,
.entry-content .wp-block-file

As a result, elements such as headings in the post content have the default sans-serif font (Inter variable or a system font) instead of the one defined for the language. Likewise, some elements in .entry-content would still display in a serif font.

The 'block-editor' and 'classic-editor' arrays may need updating as well (beyond removing .wp-block from headings in #56194). A comparison spreadsheet shows selectors from all three arrays against similar selectors in style.css.

Reviewing the languages would be good, too. For example, Persian (fa-IR) is included, but not the Afghanistan fa-AF locale.

Attachments (4)

56396.diff (4.4 KB) - added by sabernhardt 20 months ago.
add missing selectors (only)
56396.1.diff (4.4 KB) - added by sabernhardt 19 months ago.
refreshed after r54154
Capture d’écran 2022-09-25 à 23.10.36.png (409.9 KB) - added by audrasjb 19 months ago.
Before patch: Inter var used for h2
Capture d’écran 2022-09-25 à 23.10.04.png (351.6 KB) - added by audrasjb 19 months ago.
After applying patch: System font used for h2

Download all attachments as: .zip

Change History (10)

20 months ago

add missing selectors (only)

#1 @sabernhardt
20 months ago

  • Keywords has-patch added

In 56396.diff, I did not remove any selectors that are not used for fonts in style.css, such as .entry-content p.

19 months ago

refreshed after r54154

#2 @audrasjb
19 months ago

  • Keywords has-screenshots added
  • Owner set to audrasjb
  • Status changed from new to accepted

Thanks @sabernhardt! The patch fixes the issue on my side.

19 months ago

Before patch: Inter var used for h2

19 months ago

After applying patch: System font used for h2

#3 @audrasjb
19 months ago

@sabernhardt I'm wondering if we should separate the two part of this ticket: ship the selector change, but open a new ticket for the missing languages. Any thought?

#4 @sabernhardt
19 months ago

Adding support for more languages might be considered an enhancement, so the discussion and any change probably would be better in a separate ticket.

#5 @audrasjb
19 months ago

  • Keywords commit added

Alright, thank you 👍
Self assigning for commit then.

#6 @audrasjb
19 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 54314:

Twenty Twenty: Ensure the fallback fonts is applied to all content elements for non-latin languages.

This changeset adds missing CSS selectors to get_non_latin_css() function.

Props sabernhardt, audrasjb.
Fixes #56396.

Note: See TracTickets for help on using tickets.