Skip to content

Commit 8b68efd

Browse files
committed
Accessibility: Globally update .screen-reader-text class.
Remove references to the obsolete style property `clip: rect(1px, 1px, 1px, 1px);` and replace or adapt to use `clip-path: inset(50%);`. Update associated `:focus` styles as appropriate. Remove prefixed instances of `-webkit-clip-path`. Props afercia, hbhalodia, audrasjb, joedolson, sabernhardt. Fixes #62238. git-svn-id: https://develop.svn.wordpress.org/trunk@59832 602fd350-edb4-49c9-b593-d223f7449a82
1 parent a1440ae commit 8b68efd

File tree

39 files changed

+47
-95
lines changed

39 files changed

+47
-95
lines changed

src/wp-admin/css/common.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
.screen-reader-text span,
123123
.ui-helper-hidden-accessible {
124124
border: 0;
125-
clip: rect(1px, 1px, 1px, 1px);
126125
clip-path: inset(50%);
127126
height: 1px;
128127
margin: -1px;

src/wp-admin/css/install.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ body.language-chooser {
349349
.screen-reader-input,
350350
.screen-reader-text {
351351
border: 0;
352-
clip: rect(1px, 1px, 1px, 1px);
353352
clip-path: inset(50%);
354353
height: 1px;
355354
margin: -1px;

src/wp-admin/css/login.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ body.interim-login {
406406
.screen-reader-text,
407407
.screen-reader-text span {
408408
border: 0;
409-
clip: rect(1px, 1px, 1px, 1px);
410409
clip-path: inset(50%);
411410
height: 1px;
412411
margin: -1px;

src/wp-content/themes/twentyeleven/functions.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,7 @@ function twentyeleven_header_style() {
343343
#site-title,
344344
#site-description {
345345
position: absolute;
346-
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
347-
clip: rect(1px, 1px, 1px, 1px);
346+
clip-path: inset(50%);
348347
}
349348
<?php
350349
// If the user has set a custom color for the text, use that.

src/wp-content/themes/twentyeleven/inc/theme-customizer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
value.bind( function( to ) {
1616
if ( 'blank' === to ) {
1717
$( '#site-title, #site-title a, #site-description' ).css( {
18-
'clip': 'rect(1px, 1px, 1px, 1px)',
18+
'clip-path': 'inset(50%)',
1919
'position': 'absolute'
2020
} );
2121
} else {
2222
$( '#site-title, #site-title a, #site-description' ).css( {
23-
'clip': 'auto',
23+
'clip-path': 'none',
2424
'color': to,
2525
'position': 'relative'
2626
} );
2727
}
2828
} );
2929
} );
30-
} )( jQuery );
30+
} )( jQuery );

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,7 @@ a:hover {
502502
.assistive-text,
503503
.screen-reader-text {
504504
position: absolute !important;
505-
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
506-
clip: rect(1px, 1px, 1px, 1px);
505+
clip-path: inset(50%);
507506
overflow: hidden;
508507
height: 1px;
509508
width: 1px;
@@ -515,7 +514,6 @@ a.assistive-text:focus,
515514
.screen-reader-text:focus {
516515
background-color: #f1f1f1;
517516
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
518-
clip: auto !important;
519517
clip-path: none;
520518
color: #21759b;
521519
display: block;
@@ -747,8 +745,7 @@ a.assistive-text:focus,
747745
border-bottom: none;
748746
}
749747
.blog .sticky .entry-header .entry-meta {
750-
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
751-
clip: rect(1px, 1px, 1px, 1px);
748+
clip-path: inset(50%);
752749
position: absolute !important;
753750
}
754751
.entry-title,
@@ -1445,8 +1442,7 @@ section.featured-post .hentry {
14451442
margin: 0;
14461443
}
14471444
section.featured-post .entry-meta {
1448-
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
1449-
clip: rect(1px, 1px, 1px, 1px);
1445+
clip-path: inset(50%);
14501446
position: absolute !important;
14511447
}
14521448

src/wp-content/themes/twentyfifteen/inc/custom-header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function twentyfifteen_header_style() {
186186
?>
187187
.site-title,
188188
.site-description {
189-
clip: rect(1px, 1px, 1px, 1px);
189+
clip-path: inset(50%);
190190
position: absolute;
191191
}
192192
<?php endif; ?>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ a:focus {
11711171
/* Text meant only for screen readers */
11721172
.says,
11731173
.screen-reader-text {
1174-
clip: rect(1px, 1px, 1px, 1px);
1174+
clip-path: inset(50%);
11751175
height: 1px;
11761176
overflow: hidden;
11771177
position: absolute !important;
@@ -1199,7 +1199,7 @@ a:focus {
11991199
}
12001200

12011201
.site .skip-link:focus {
1202-
clip: auto;
1202+
clip-path: none;
12031203
height: auto;
12041204
left: 6px;
12051205
top: 7px;

src/wp-content/themes/twentyfourteen/inc/custom-header.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ function twentyfourteen_header_style() {
7676
?>
7777
.site-title,
7878
.site-description {
79-
clip: rect(1px 1px 1px 1px); /* IE7 */
80-
clip: rect(1px, 1px, 1px, 1px);
79+
clip-path: inset(50%);
8180
position: absolute;
8281
}
8382
<?php

src/wp-content/themes/twentyfourteen/js/customizer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
value.bind( function( to ) {
2121
if ( 'blank' === to ) {
2222
$( '.site-title, .site-description' ).css( {
23-
'clip': 'rect(1px, 1px, 1px, 1px)',
23+
'clip-path': 'inset(50%)',
2424
'position': 'absolute'
2525
} );
2626
} else {
2727
$( '.site-title, .site-description' ).css( {
28-
'clip': 'auto',
28+
'clip-path': 'none',
2929
'position': 'static'
3030
} );
3131

@@ -35,4 +35,4 @@
3535
}
3636
} );
3737
} );
38-
} )( jQuery );
38+
} )( jQuery );

0 commit comments

Comments
 (0)