Changeset 51083
- Timestamp:
- 06/07/2021 11:09:56 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/wp/theme.js
r50813 r51083 405 405 406 406 // Render themes using the html template. 407 this.$el.html( this.html( data ) ).attr({ 408 tabindex: 0, 409 'aria-describedby' : data.id + '-action ' + data.id + '-name', 410 'data-slug': data.id 411 }); 407 this.$el.html( this.html( data ) ).attr( 'data-slug', data.id ); 412 408 413 409 // Renders active theme styles. … … 765 761 // Return focus to the theme div. 766 762 if ( themes.focusedTheme ) { 767 themes.focusedTheme. trigger( 'focus' );763 themes.focusedTheme.find('.more-details').trigger( 'focus' ); 768 764 } 769 765 }); … … 953 949 // Return focus to the theme div. 954 950 if ( themes.focusedTheme ) { 955 themes.focusedTheme. trigger( 'focus' );951 themes.focusedTheme.find('.more-details').trigger( 'focus' ); 956 952 } 957 953 }).removeClass( 'iframe-ready' ); -
trunk/src/wp-admin/css/themes.css
r50784 r51083 67 67 68 68 .theme-browser .theme:hover, 69 .theme-browser .theme :focus {69 .theme-browser .theme.focus { 70 70 cursor: pointer; 71 71 } … … 96 96 97 97 .theme-browser .theme:hover .theme-actions, 98 .theme-browser .theme.focus .theme-actions, 99 .theme-browser .theme:focus .theme-actions { 98 .theme-browser .theme.focus .theme-actions { 100 99 -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; 101 100 opacity: 1; … … 141 140 142 141 .theme-browser .theme:hover .theme-screenshot, 143 .theme-browser .theme :focus .theme-screenshot {142 .theme-browser .theme.focus .theme-screenshot { 144 143 background: #fff; 145 144 } 146 145 147 146 .theme-browser.rendered .theme:hover .theme-screenshot img, 148 .theme-browser.rendered .theme :focus .theme-screenshot img {147 .theme-browser.rendered .theme.focus .theme-screenshot img { 149 148 opacity: 0.4; 150 149 } … … 157 156 right: 20%; 158 157 left: 20%; 158 width: 60%; 159 159 background: #1d2327; 160 160 background: rgba(0, 0, 0, 0.7); … … 170 170 } 171 171 172 .theme-browser .theme:focus { 172 .theme-browser .theme .more-details:focus { 173 box-shadow: 0 0 0 1px #fff, 0 0 0 3px #2271b1; 174 } 175 176 .theme-browser .theme.focus { 173 177 border-color: #4f94d4; 174 178 box-shadow: 0 0 2px rgba(79, 148, 212, 0.8); 175 179 } 176 180 177 .theme-browser .theme :focus .more-details {181 .theme-browser .theme.focus .more-details { 178 182 opacity: 1; 179 183 } 180 184 181 185 /* Current theme needs to have its action always on view */ 182 .theme-browser .theme.active :focus .theme-actions {186 .theme-browser .theme.active.focus .theme-actions { 183 187 display: block; 184 188 } 185 189 186 190 .theme-browser.rendered .theme:hover .more-details, 187 .theme-browser.rendered .theme :focus .more-details {191 .theme-browser.rendered .theme.focus .more-details { 188 192 -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; 189 193 opacity: 1; … … 878 882 .theme:not(.active):focus .theme-actions, 879 883 .theme:hover .more-details, 880 .theme :focus .more-details {884 .theme.focus .more-details { 881 885 display: none; 882 886 } 883 887 884 888 .theme-browser.rendered .theme:hover .theme-screenshot img, 885 .theme-browser.rendered .theme :focus .theme-screenshot img {889 .theme-browser.rendered .theme.focus .theme-screenshot img { 886 890 opacity: 1.0; 887 891 } -
trunk/src/wp-admin/themes.php
r50696 r51083 371 371 } 372 372 ?> 373 <div class="theme<?php echo $active_class; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">373 <div class="theme<?php echo $active_class; ?>"> 374 374 <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?> 375 375 <div class="theme-screenshot"> … … 504 504 ?> 505 505 506 <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span> 506 <?php 507 /* translators: %s: Theme name. */ 508 $details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), $theme['name'] ); 509 ?> 510 <button type="button" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></button> 507 511 <div class="theme-author"> 508 512 <?php … … 523 527 <div class="theme-actions"> 524 528 <?php if ( $theme['active'] ) { ?> 525 <?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> 526 <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a> 529 <?php 530 if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { 531 /* translators: %s: Theme name. */ 532 $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), $theme['name'] ); 533 ?> 534 <a aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a> 527 535 <?php } ?> 528 536 <?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?> … … 532 540 ?> 533 541 <a class="button activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a> 534 <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?> 535 <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a> 542 <?php 543 if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { 544 /* translators: %s: Theme name. */ 545 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 546 ?> 547 <a aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a> 536 548 <?php } ?> 537 549 <?php } else { ?> … … 851 863 <# } #> 852 864 853 <span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span> 865 <?php 866 /* translators: %s: Theme name. */ 867 $details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), '{{ data.name }}' ); 868 ?> 869 <button type="button" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></button> 854 870 <div class="theme-author"> 855 871 <?php … … 871 887 <# if ( data.active ) { #> 872 888 <# if ( data.actions.customize ) { #> 873 <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a> 889 <?php 890 /* translators: %s: Theme name. */ 891 $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), '{{ data.name }}' ); 892 ?> 893 <a aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a> 874 894 <# } #> 875 895 <# } else { #> … … 880 900 ?> 881 901 <a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a> 882 <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a> 902 <?php 903 /* translators: %s: Theme name. */ 904 $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); 905 ?> 906 <a aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a> 883 907 <# } else { #> 884 908 <?php … … 1109 1133 1110 1134 <# if ( ! data.active && data.actions['delete'] ) { #> 1111 <a href="{{{ data.actions['delete'] }}}" class="button delete-theme"><?php _e( 'Delete' ); ?></a> 1135 <?php 1136 /* translators: %s: Theme name. */ 1137 $aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{ data.name }}' ); 1138 ?> 1139 <a href="{{{ data.actions['delete'] }}}" class="button delete-theme" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Delete' ); ?></a> 1112 1140 <# } #> 1113 1141 </div>
Note: See TracChangeset
for help on using the changeset viewer.