Accessibility: Update and standardize the admin `screen-reader-text` CSS class.

Given the new WordPress browsers support policy, the `screen-reader-text` css
class used in the admin can be updated to use modern CSS and correct syntax. See
https://github.com/wpaccessibility/a11ythemepatterns/blob/master/read-more-links/style.css

Worth noting the `clip` property is deprecated and kept for IE11 and Edge.

- uses `clip-path` for modern browsers
- keeps `clip` for old browsers and update its value to a correct syntax
- resets `clip-path` to `none` where the class is used to dynamically reveal elements
- removes an old rule that made `screen-reader-text` completely invisible in the help tabs `#screen-meta`
- standardizes the rule across CSS files

Fixes #40970.

Built from https://develop.svn.wordpress.org/trunk@41622


git-svn-id: http://core.svn.wordpress.org/trunk@41457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrea Fercia 2017-09-27 17:27:45 +00:00
parent 8c7a2b1d54
commit c65fe27ba1
24 changed files with 73 additions and 58 deletions

View File

@ -121,14 +121,15 @@
.screen-reader-text, .screen-reader-text,
.screen-reader-text span, .screen-reader-text span,
.ui-helper-hidden-accessible { .ui-helper-hidden-accessible {
position: absolute;
margin: -1px;
padding: 0;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0; border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */ word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
} }
@ -1617,10 +1618,6 @@ form.upgrade .hint {
margin-right: 0 !important; margin-right: 0 !important;
} }
#screen-meta .screen-reader-text {
visibility: hidden;
}
#screen-meta-links { #screen-meta-links {
margin: 0 0 0 20px; margin: 0 0 0 20px;
} }

File diff suppressed because one or more lines are too long

View File

@ -121,14 +121,15 @@
.screen-reader-text, .screen-reader-text,
.screen-reader-text span, .screen-reader-text span,
.ui-helper-hidden-accessible { .ui-helper-hidden-accessible {
position: absolute;
margin: -1px;
padding: 0;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0; border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */ word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
} }
@ -1617,10 +1618,6 @@ form.upgrade .hint {
margin-left: 0 !important; margin-left: 0 !important;
} }
#screen-meta .screen-reader-text {
visibility: hidden;
}
#screen-meta-links { #screen-meta-links {
margin: 0 20px 0 0; margin: 0 20px 0 0;
} }

File diff suppressed because one or more lines are too long

View File

@ -402,14 +402,16 @@ body.language-chooser {
.screen-reader-input, .screen-reader-input,
.screen-reader-text { .screen-reader-text {
position: absolute;
margin: -1px;
padding: 0;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0; border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important;
} }
.spinner { .spinner {

File diff suppressed because one or more lines are too long

View File

@ -402,14 +402,16 @@ body.language-chooser {
.screen-reader-input, .screen-reader-input,
.screen-reader-text { .screen-reader-text {
position: absolute;
margin: -1px;
padding: 0;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0; border: 0;
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important;
} }
.spinner { .spinner {

File diff suppressed because one or more lines are too long

View File

@ -1821,6 +1821,7 @@ div.action-links,
/* Show comment bubble as text instead */ /* Show comment bubble as text instead */
.post-com-count .screen-reader-text { .post-com-count .screen-reader-text {
position: static; position: static;
clip-path: none;
width: auto; width: auto;
height: auto; height: auto;
margin: 0; margin: 0;

File diff suppressed because one or more lines are too long

View File

@ -1821,6 +1821,7 @@ div.action-links,
/* Show comment bubble as text instead */ /* Show comment bubble as text instead */
.post-com-count .screen-reader-text { .post-com-count .screen-reader-text {
position: static; position: static;
clip-path: none;
width: auto; width: auto;
height: auto; height: auto;
margin: 0; margin: 0;

File diff suppressed because one or more lines are too long

View File

@ -599,6 +599,7 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
.no-js.nav-menus-php .item-edit .screen-reader-text { .no-js.nav-menus-php .item-edit .screen-reader-text {
position: static; position: static;
clip-path: none;
width: auto; width: auto;
height: auto; height: auto;
margin: 0; margin: 0;

File diff suppressed because one or more lines are too long

View File

@ -599,6 +599,7 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
.no-js.nav-menus-php .item-edit .screen-reader-text { .no-js.nav-menus-php .item-edit .screen-reader-text {
position: static; position: static;
clip-path: none;
width: auto; width: auto;
height: auto; height: auto;
margin: 0; margin: 0;

File diff suppressed because one or more lines are too long

View File

@ -691,12 +691,16 @@ html:lang(he-il) .rtl #wpadminbar * {
/* Skip link */ /* Skip link */
#wpadminbar .screen-reader-text, #wpadminbar .screen-reader-text,
#wpadminbar .screen-reader-text span { #wpadminbar .screen-reader-text span {
position: absolute; border: 0;
right: -1000em; clip: rect(1px, 1px, 1px, 1px);
top: -1000em; clip-path: inset(50%);
height: 1px; height: 1px;
width: 1px; margin: -1px;
overflow: hidden; overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important;
} }
#wpadminbar .screen-reader-shortcut { #wpadminbar .screen-reader-shortcut {

File diff suppressed because one or more lines are too long

View File

@ -691,12 +691,16 @@ html:lang(he-il) .rtl #wpadminbar * {
/* Skip link */ /* Skip link */
#wpadminbar .screen-reader-text, #wpadminbar .screen-reader-text,
#wpadminbar .screen-reader-text span { #wpadminbar .screen-reader-text span {
position: absolute; border: 0;
left: -1000em; clip: rect(1px, 1px, 1px, 1px);
top: -1000em; clip-path: inset(50%);
height: 1px; height: 1px;
width: 1px; margin: -1px;
overflow: hidden; overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
word-wrap: normal !important;
} }
#wpadminbar .screen-reader-shortcut { #wpadminbar .screen-reader-shortcut {

File diff suppressed because one or more lines are too long

View File

@ -9,11 +9,16 @@ body {
/* Text meant only for screen readers */ /* Text meant only for screen readers */
.screen-reader-text { .screen-reader-text {
border: 0;
clip: rect(1px, 1px, 1px, 1px); clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px; height: 1px;
margin: -1px;
overflow: hidden; overflow: hidden;
position: absolute !important; padding: 0;
position: absolute;
width: 1px; width: 1px;
word-wrap: normal !important;
} }
/* Dashicons */ /* Dashicons */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.9-alpha-41621'; $wp_version = '4.9-alpha-41622';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.