Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/js/_enqueues/wp/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@ themes.view.InstallerSearch = themes.view.Search.extend({
request.tag = [ value.slice( 4 ) ];
}

$( '.filter-links li > a.current' )
$( '.filter-links [data-sort].current' )
.removeClass( 'current' )
.removeAttr( 'aria-current' );

Expand All @@ -1675,7 +1675,7 @@ themes.view.Installer = themes.view.Appearance.extend({

// Register events for sorting and filters in theme-navigation.
events: {
'click .filter-links li > a': 'onSort',
'click .filter-links [data-sort]': 'onSort',
'click .theme-filter': 'onFilter',
'click .drawer-toggle': 'moreFilters',
'click .filter-drawer .apply-filters': 'applyFilters',
Expand Down Expand Up @@ -1786,7 +1786,7 @@ themes.view.Installer = themes.view.Appearance.extend({
// Track sorting so we can restore the correct tab when closing preview.
themes.router.selectedTab = sort;

$( '.filter-links li > a, .theme-filter' )
$( '.filter-links [data-sort], .theme-filter' )
.removeClass( this.activeClass )
.removeAttr( 'aria-current' );

Expand Down Expand Up @@ -1814,7 +1814,7 @@ themes.view.Installer = themes.view.Appearance.extend({
return;
}

$( '.filter-links li > a, .theme-section' )
$( '.filter-links [data-sort], .theme-section' )
.removeClass( this.activeClass )
.removeAttr( 'aria-current' );
$el
Expand Down Expand Up @@ -1857,7 +1857,7 @@ themes.view.Installer = themes.view.Appearance.extend({
}

$( 'body' ).addClass( 'filters-applied' );
$( '.filter-links li > a.current' )
$( '.filter-links [data-sort].current' )
.removeClass( 'current' )
.removeAttr( 'aria-current' );

Expand Down
24 changes: 20 additions & 4 deletions src/wp-admin/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -1087,13 +1087,27 @@ th.action-links {
margin: 0;
}

.filter-links li > a {
.filter-links li > a,
.filter-links li > button {
display: inline-block;
margin: 0 10px;
padding: 15px 0;
border: 0;
border-bottom: 4px solid #fff;
background: none;
color: #646970;
cursor: pointer;
font: inherit;
transition-property: border, background, color;
transition-duration: .05s;
transition-timing-function: ease-in-out;
}

.filter-links li > button:focus {
border-radius: 2px;
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 1.5px) var(--wp-admin-theme-color, #3858e9);
/* Only visible in Windows High Contrast mode */
outline: 2px solid transparent;
}

.filter-links .current {
Expand All @@ -1106,8 +1120,10 @@ th.action-links {

.filter-links li > a:hover,
.filter-links li > a:focus,
.show-filters .filter-links a.current:hover,
.show-filters .filter-links a.current:focus {
.filter-links li > button:hover,
.filter-links li > button:focus,
.show-filters .filter-links .current:hover,
.show-filters .filter-links .current:focus {
color: var(--wp-admin-theme-color);
}

Expand Down Expand Up @@ -1237,7 +1253,7 @@ th.action-links {
display: block;
}

.show-filters .filter-links a.current {
.show-filters .filter-links .current {
border-bottom: none;
}

Expand Down
8 changes: 4 additions & 4 deletions src/wp-admin/theme-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@
</div>

<ul class="filter-links">
<li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
<li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
<li><a href="#" data-sort="block-themes"><?php _ex( 'Block Themes', 'themes' ); ?></a></li>
<li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
<li><button type="button" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></button></li>
<li><button type="button" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></button></li>
<li><button type="button" data-sort="block-themes"><?php _ex( 'Block Themes', 'themes' ); ?></button></li>
<li><button type="button" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></button></li>
</ul>

<button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
Expand Down
Loading