Skip to content

Commit 529d53b

Browse files
Better tabbing order for shop filters.
1 parent 7edf77a commit 529d53b

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

app/integrations/woocommerce/template-hooks.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
* File: archive-product.php.
3636
*/
3737

38+
// Move sidebar before content for better tab order.
39+
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar' );
40+
add_action( 'woocommerce_before_main_content', 'woocommerce_get_sidebar', 0 );
41+
3842
// Replace outer content wrapper.
3943
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper' );
4044
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end' );

resources/assets/scss/app.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
@import "modules/screen-reader-text";
3636
@import "modules/offcanvas-drawer";
3737
@import "modules/menu-item";
38+
@import "modules/skip-link";
3839

3940
// Forms
4041
@import "modules/form-row";
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.skip-link {
2+
background-color: #f1f1f1;
3+
color: #0073aa;
4+
display: block;
5+
font: bold 14px/normal "Noto Sans", sans-serif;
6+
left: -9999em;
7+
outline: none;
8+
padding: 15px 23px 14px;
9+
text-decoration: none;
10+
text-transform: none;
11+
top: -9999em;
12+
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
13+
14+
&:focus {
15+
clip: auto;
16+
height: auto;
17+
left: 6px;
18+
top: 7px;
19+
width: auto;
20+
z-index: 100000;
21+
}
22+
}

resources/views/integrations/woocommerce/archive-product-page.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
<h1 class="woocommerce-products-header__title page-title"><?php the_title(); ?></h1>
3838
</header>
3939

40-
<?php the_content(); ?>
41-
4240
<?php
41+
the_content();
42+
4343
endwhile;
4444

4545
/**

resources/views/integrations/woocommerce/global/sidebar.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
?>
3030

3131
<div id="secondary" class="site-secondary shop-filters" role="complementary">
32+
<a class="skip-link screen-reader-text" href="#main"><?php esc_html_e( 'Skip to results', 'bigbox' ); ?></a>
33+
3234
<div class="offcanvas-drawer__content">
3335
<?php echo $sidebar; // WPCS: XSS okay. ?>
3436
</div>

0 commit comments

Comments
 (0)