Skip to content

Commit ed2c275

Browse files
committed
A11y: Update .screen-reader-text class with word-break.
`word-break: normal !important;` was added to Twenty Twenty in [46701], but the change missed getting propagated to all uses of the screen-reader-text class at that time. Add `word-break` reset to `.screen-reader-text` to ensure screen readers won't read text as individual letters in hidden text. Props peterwilsoncc, manhphucofficial, palak678, sabernhardt, mukesh27, joedolson. Fixes #64375. git-svn-id: https://develop.svn.wordpress.org/trunk@61636 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6e8eba1 commit ed2c275

20 files changed

Lines changed: 47 additions & 13 deletions

File tree

src/wp-admin/css/common.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@
129129
padding: 0;
130130
position: absolute;
131131
width: 1px;
132-
word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
132+
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
133+
word-wrap: normal !important;
134+
word-break: normal !important;
133135
}
134136

135137
.button .screen-reader-text {

src/wp-admin/css/customize-controls.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2686,7 +2686,9 @@ body.adding-widget .add-new-widget:before,
26862686
padding: 0;
26872687
position: absolute;
26882688
width: 1px;
2689+
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
26892690
word-wrap: normal !important;
2691+
word-break: normal !important;
26902692
}
26912693

26922694
#available-widgets .customize-section-title button,

src/wp-admin/css/install.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ body.language-chooser {
356356
padding: 0;
357357
position: absolute;
358358
width: 1px;
359+
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
359360
word-wrap: normal !important;
361+
word-break: normal !important;
360362
}
361363

362364
.spinner {

src/wp-admin/css/login.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ body.interim-login {
413413
padding: 0;
414414
position: absolute;
415415
width: 1px;
416-
word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
416+
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
417+
word-wrap: normal !important;
418+
word-break: normal !important;
417419
}
418420

419421
/* Hide the Edge "reveal password" native button */

src/wp-content/themes/twentynineteen/sass/modules/_accessibility.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
padding: 0;
99
position: absolute !important;
1010
width: 1px;
11-
word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */
11+
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
12+
word-wrap: normal !important;
13+
word-break: normal !important;
1214

1315
&:focus {
1416
background-color: $color__background-screen;

src/wp-content/themes/twentynineteen/style-rtl.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3627,8 +3627,9 @@ body.page .main-navigation {
36273627
padding: 0;
36283628
position: absolute !important;
36293629
width: 1px;
3630-
word-wrap: normal !important;
36313630
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
3631+
word-wrap: normal !important;
3632+
word-break: normal !important;
36323633
}
36333634

36343635
.screen-reader-text:focus {

src/wp-content/themes/twentynineteen/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3627,8 +3627,9 @@ body.page .main-navigation {
36273627
padding: 0;
36283628
position: absolute !important;
36293629
width: 1px;
3630-
word-wrap: normal !important;
36313630
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
3631+
word-wrap: normal !important;
3632+
word-break: normal !important;
36323633
}
36333634

36343635
.screen-reader-text:focus {

src/wp-content/themes/twentyseventeen/style.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,9 @@ template {
311311
overflow: hidden;
312312
position: absolute !important;
313313
width: 1px;
314-
word-wrap: normal !important; /* Many screen reader and browser combinations announce broken words as they would appear visually. */
314+
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
315+
word-wrap: normal !important;
316+
word-break: normal !important;
315317
}
316318

317319
.screen-reader-text:focus {

src/wp-content/themes/twentysixteen/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,8 +1289,9 @@ a:active {
12891289
overflow: hidden;
12901290
position: absolute !important;
12911291
width: 1px;
1292-
/* many screen reader and browser combinations announce broken words as they would appear visually */
1292+
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
12931293
word-wrap: normal !important;
1294+
word-break: normal !important;
12941295
}
12951296

12961297
/* must have higher specificity than alternative color schemes inline styles */

src/wp-content/themes/twentytwenty/style-rtl.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ path {
185185
padding: 0;
186186
position: absolute !important;
187187
width: 1px;
188+
/* Many screen reader and browser combinations announce broken words as they would appear visually. */
188189
word-wrap: normal !important;
189-
word-break: normal;
190+
word-break: normal !important;
190191
}
191192

192193
.screen-reader-text:focus {

0 commit comments

Comments
 (0)