Make WordPress Core

Opened 6 months ago

Last modified 6 weeks ago

#58603 accepted defect (bug)

Twenty Twenty-Three: Update font sizes to ensure accessible responsive typography

Reported by: mikachan's profile mikachan Owned by: joedolson's profile joedolson
Milestone: 6.5 Priority: normal
Severity: normal Version: 6.3
Component: Bundled Theme Keywords: has-patch needs-testing needs-screenshots
Focuses: accessibility Cc:

Description

After seeing @ryokuhi's tutorial on how to calculate accessible responsive typography, I believe some of the font size presets should be updated in Twenty Twenty-Three to ensure that all typography is as accessible as possible.

@ryokuhi explains a simple formula to calculate the ratio between the min and max font size values to ensure the resulting size is accessible: [min font-size] / [max font-size] >= 0.61

I believe the xx-large font size presets in the following variations should be updated to follow this rule:

  • Default variation
  • Aubergine
  • Block-out
  • Pitch
  • Whisper

Change History (12)

This ticket was mentioned in PR #4676 on WordPress/wordpress-develop by @mikachan.


6 months ago
#1

  • Keywords has-patch added

This updates some of the font-size presets in Twenty Twenty-Three to ensure that all responsive typography is as accessible as possible.

I used the following calculation to find these values: [min font-size] / [max font-size] >= 0.61

For example, Twenty Twenty-Three's old xx-large font-size: 4rem / 10rem = 0.4.

Compared to the new xx-large font-size: 6.1rem / 10rem = 0.61

Many thanks to @Ryokuhi for providing a great explanation of accessible responsive typography, and an easy formula for working out accessible font size values 🙇

Please let me know if any of these values don't look correct!

Trac ticket: https://core.trac.wordpress.org/ticket/58603

#2 @sabernhardt
6 months ago

  • Focuses accessibility added

#3 @mikachan
5 months ago

  • Keywords needs-testing added

#4 @mikachan
5 months ago

  • Type changed from enhancement to defect (bug)

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


5 months ago

#6 @joedolson
5 months ago

  • Keywords needs-screenshots added

While we definitely would *like* to do this, we have some significant concerns about changing font sizing in an already released theme, and the impact that could have on user's existing designs.

If we can do enough testing to verify that these changes don't impact existing designs in the majority of scenarios, this might be feasible.

We definitely want to take this into consideration for a new theme variation and for future core themes, however.

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


5 months ago

#8 @poena
4 months ago

Are the default font size presets, the ones provided by core, accessible?

#9 @mikachan
4 months ago

While we definitely would *like* to do this, we have some significant concerns about changing font sizing in an already released theme, and the impact that could have on user's existing designs.

I understand; it's definitely not ideal to potentially impact so many existing designs with font size changes. The proposed changes only affect the XX-Large font size preset, so likely not the most popular size, but this still has the potential to impact existing designs at varying screen sizes.

Are the default font size presets, the ones provided by core, accessible?

Good point! I've just created a blank theme and enabled fluid typography, these are the font sizes I see:

Small: static 13px
Medium: clamp(14px, 0.875rem + ((1vw - 3.2px) * 0.882), 20px): 14/20 = 0.7 ✅
Large: clamp(22.041px, 1.378rem + ((1vw - 3.2px) * 2.053), 36px): 22.041/36 = 0.61 ✅
X-Large: clamp(25.014px, 1.563rem + ((1vw - 3.2px) * 2.498), 42px): 25.014/42 = 0.59 ❌

So most of the presets are accessible fluid sizes apart from X-Large, which is just below the recommended 0.61 ratio.

#10 @joedolson
3 months ago

If we could bump the default x-large to 25.62, we'd meet the ratio. This seems like something worth doing; it's a pretty minor change to make.

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


6 weeks ago

#12 @joedolson
6 weeks ago

  • Milestone changed from Awaiting Review to 6.5
  • Owner set to joedolson
  • Status changed from new to accepted
Note: See TracTickets for help on using tickets.