#64375 closed defect (bug) (fixed)
Set `word-break` property in screen reader only css.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch commit needs-dev-note |
| Focuses: | accessibility, css | Cc: |
Description
While using the screen-reader-only class from WordPress recently, I noticed that the word-break property set to a value other than normal can cause VoiceOver to read text strangely.
In the example I experienced the phrase "read text" was read as "R E A D space T E X T" due to an inherited word-break: break-word.
In WordPress Core, I think we should add word-break: normal !important to CSS hiding elements from all but screen reading devices.
Change History (14)
This ticket was mentioned in PR #10610 on WordPress/wordpress-develop by @peterwilsoncc.
6 months ago
#1
- Keywords has-patch added
#2
@
6 months ago
I've noticed some inconsistencies how these are styled across various locations, I presume because best practice has changed over the years. It would be good to make them consistent using the currently recommended method.
@joedolson Do you have a suggestion for the most accessible CSS to use?
#3
@
6 months ago
I’m supportive of this fix.
Adding word-break: normal !important to screen-reader-only text is a sensible safeguard, as inherited break-word can cause the letter-by-letter announcements described above. The change looks low-risk, improves consistency, and doesn’t alter visual output.
A follow-up to standardize the various visually-hidden patterns across Core would also be helpful. Happy to help test any future refinements.
#4
@
6 months ago
This change makes sense from an accessibility perspective. Adding word-break: normal !important ensures screen-reader-only text is read as complete words instead of being split unnaturally, which improves the overall screen reader experience.
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
5 months ago
#6
@
5 months ago
See prior discussion on #48533. This was an oversight, and should be added into the core class and propagated through all other usages.
#7
@
5 months ago
- Keywords needs-refresh added
The PR will need a refresh after [61469], and Twenty Twenty-One's .map files might require updating too.
@joedolson commented on PR #10610:
4 months ago
#9
Added two additional cases that were omitted in the PR; restored one that had been removed in a deprecated function. Could go either way on that, but I think it's better to fix the issue even if it's going to be rarely used.
#12
@
4 months ago
- Owner set to joedolson
- Resolution set to fixed
- Status changed from new to closed
In 61636:
#13
@
4 months ago
Issue opened https://github.com/WordPress/gutenberg/issues/75533; documentation at make.wordpress.org/accessibility updated.
#14
@
4 months ago
- Keywords needs-dev-note added
This should get a dev note, equivalent to https://make.wordpress.org/core/2025/03/20/changes-to-the-screen-reader-text-class-in-wordpress-6-8/
Adds
word-break: normal !importantto various screen reader only CSS.This prevents screen readers from announcing the text as it would appear visually, eg "A P P E A R space V I S U A L L Y".
Trac ticket: https://core.trac.wordpress.org/ticket/64375