Skip to content

Commit a4dab60

Browse files
committed
Customize: Improve keyboard accessibility for publish settings section.
Props sayedwp. See #39896. Fixes #42027. git-svn-id: https://develop.svn.wordpress.org/trunk@41802 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2ab2764 commit a4dab60

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

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

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ body:not(.ready) #customize-save-button-wrapper .save {
3838
box-shadow: none; /* @todo Adjust box shadow based on the disable states of paired button. */
3939
margin-top: 0;
4040
}
41+
42+
#customize-save-button-wrapper .save:focus, #publish-settings:focus {
43+
box-shadow: 0 1px 0 #0073aa, 0 0 2px 1px #33b3db; /* This is default box shadow for focus */
44+
}
45+
4146
#customize-save-button-wrapper .save.has-next-sibling {
4247
border-radius: 3px 0 0 3px;
4348
}
@@ -46,16 +51,17 @@ body:not(.ready) #customize-save-button-wrapper .save {
4651
position: absolute;
4752
top: 0;
4853
bottom: 0;
49-
left: -301px;
54+
left: 0;
5055
visibility: hidden;
5156
overflow-x: hidden;
5257
overflow-y: auto;
53-
width: 300px;
58+
width: 100%;
5459
margin: 0;
55-
z-index: 4;
60+
z-index: -1;
5661
background: #eee;
5762
transition: left .18s;
5863
border-right: 1px solid #ddd;
64+
border-left: 1px solid #ddd;
5965
height: 100%;
6066
}
6167

@@ -73,7 +79,7 @@ body:not(.ready) #customize-save-button-wrapper .save {
7379

7480
.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content {
7581
visibility: visible;
76-
left: 0;
82+
left: 100%;
7783
transition: left .18s;
7884
}
7985

@@ -132,6 +138,10 @@ body.trashing #publish-settings {
132138
overflow-x: hidden;
133139
}
134140

141+
.outer-section-open #customize-controls .wp-full-overlay-sidebar-content {
142+
background: #eee;
143+
}
144+
135145
#customize-controls .customize-info {
136146
border: none;
137147
border-bottom: 1px solid #ddd;
@@ -2828,6 +2838,14 @@ body.adding-widget .add-new-widget:before,
28282838
width: 100%;
28292839
}
28302840

2841+
body.wp-customizer .wp-full-overlay.expanded #customize-sidebar-outer-content {
2842+
left: -100%;
2843+
}
2844+
2845+
body.wp-customizer.outer-section-open .wp-full-overlay.expanded #customize-sidebar-outer-content {
2846+
left: 0;
2847+
}
2848+
28312849
#available-widgets .customize-section-title,
28322850
#available-menu-items .customize-section-title {
28332851
display: block;
@@ -2882,4 +2900,4 @@ body.adding-widget .add-new-widget:before,
28822900
.reordering .reorder-done {
28832901
padding: 8px;
28842902
}
2885-
}
2903+
}

src/wp-admin/customize.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@
164164
</a>
165165
</div>
166166

167+
<div id="customize-sidebar-outer-content">
168+
<div id="customize-outer-theme-controls">
169+
<ul class="customize-outer-pane-parent"><?php // Outer panel and sections are not implemented, but its here as a placeholder to avoid any side-effect in api.Section. ?></ul>
170+
</div>
171+
</div>
172+
167173
<div id="widgets-right" class="wp-clearfix"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the Customizer for compat -->
168174
<div id="customize-notifications-area" class="customize-control-notifications-container">
169175
<ul></ul>
@@ -217,11 +223,6 @@
217223
</div>
218224
</form>
219225
<div id="customize-preview" class="wp-full-overlay-main"></div>
220-
<div id="customize-sidebar-outer-content">
221-
<div id="customize-outer-theme-controls">
222-
<ul class="customize-outer-pane-parent"><?php // Outer panel and sections are not implemented, but its here as a placeholder to avoid any side-effect in api.Section. ?></ul>
223-
</div>
224-
</div>
225226
<?php
226227

227228
/**

src/wp-includes/class-wp-customize-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3770,7 +3770,7 @@ public function render_control_templates() {
37703770
<span class="preview-control-element" data-component="url"></span>
37713771
<span class="screen-reader-text"><?php _e( '(opens in a new window)' ); ?></span>
37723772
</a>
3773-
<input id="{{ elementPrefix }}customize-preview-link-input" readonly class="preview-control-element" data-component="input">
3773+
<input id="{{ elementPrefix }}customize-preview-link-input" readonly tabindex="-1" class="preview-control-element" data-component="input">
37743774
<button class="customize-copy-preview-link preview-control-element button button-secondary" data-component="button" data-copy-text="<?php esc_attr_e( 'Copy' ); ?>" data-copied-text="<?php esc_attr_e( 'Copied' ); ?>" ><?php esc_html_e( 'Copy' ); ?></button>
37753775
</div>
37763776
</script>

0 commit comments

Comments
 (0)