Skip to content

Commit

Permalink
BCTHEME-293 Product list item Quick view button is not tabbable (#1900)…
Browse files Browse the repository at this point in the history
… (#1900)

Co-authored-by: BC-tymurbiedukhin <66319629+BC-tymurbiedukhin@users.noreply.github.com>
  • Loading branch information
yurytut1993 and BC-tymurbiedukhin authored Nov 17, 2020
1 parent 8569e6b commit 7d57ec5
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Product list item Quick view button is not tabbable. [#1900](https://github.com/bigcommerce/cornerstone/pull/1900)
- Social icon tooltip displaying should be fixed. [1907](https://github.com/bigcommerce/cornerstone/pull/1907)
- Faceted search filters are hidden from screen readers. [#1897](https://github.com/bigcommerce/cornerstone/pull/1897)
- Write a review modal extra executions. [#1902](https://github.com/bigcommerce/cornerstone/pull/1902)
Expand Down
40 changes: 28 additions & 12 deletions assets/scss/layouts/products/_productList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@
// -----------------------------------------------------------------------------

.listItem {
&:focus-within {
.listItem-figureBody {
@include breakpoint("large") {
opacity: 1;
}
}
}

&.focus-within {
.listItem-figureBody {
@include breakpoint("large") {
opacity: 1;
}
}
}

@include breakpoint("small") {
@include grid-row($behavior: "nest");
Expand Down Expand Up @@ -52,7 +67,8 @@
border-color: $card-figcaption-button-borderColor;
color: $card-figcaption-button-color;

&:hover {
&:hover,
&:focus {
background-color: $card-figcaption-button-backgroundHover;
border-color: $card-figcaption-button-borderColor;
color: $card-figcaption-button-color;
Expand All @@ -67,6 +83,11 @@
margin: 0 0 spacing("single");
position: relative;

&__link {
display: block;
margin: 3px;
}

@include breakpoint("small") {
margin-bottom: 0;
padding-left: spacing("half");
Expand All @@ -78,30 +99,25 @@
margin: spacing("single") 0;

@include breakpoint("large") {
@include verticalPositionMiddle();
display: inline-block;
margin: 0 0 spacing("single");
margin: 0;
pointer-events: all;
transform-style: preserve-3d;
}
}

}
}

.listItem-figureBody {
opacity: 1;
text-align: center;

@include breakpoint("large") {
bottom: 0;
height: 100%;
left: spacing("half");
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
opacity: 0;
position: absolute;
right: spacing("half");
top: 0;

&:hover {
.listItem:hover & {
opacity: 1;
}
}
Expand Down
12 changes: 10 additions & 2 deletions templates/components/products/list-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<article class="listItem">
{{/if}}
<figure class="listItem-figure">
<a href="{{url}}"
class="listItem-figure__link"
aria-label="{{name}},{{> components/products/product-aria-label}}"
{{#if settings.data_tag_enabled}}
data-event-type="product-click"
{{/if}}
>
{{#or price.sale_price_with_tax.value price.sale_price_without_tax.value}}
{{#if theme_settings.product_sale_badges '===' 'sash'}}
<div class="sale-flag-sash">
Expand All @@ -19,18 +26,19 @@
<div class="sale-flag-star"></div>
</div>
{{/if}}
{{/or}}
{{/or}}
{{> components/common/responsive-img
image=image
class="listItem-image"
fallback_size=theme_settings.productgallery_size
lazyload=theme_settings.lazyload_mode
default_image=theme_settings.default_image_product
}}
</a>
{{#unless hide_product_quick_view}}
{{#if theme_settings.show_product_quick_view}}
<div class="listItem-figureBody">
<a {{#if settings.data_tag_enabled}} data-event-type="product-click" {{/if}} class="button button--small listItem-button quickview" data-product-id="{{id}}">{{lang 'products.quick_view'}}</a>
<button type="button" {{#if settings.data_tag_enabled}} data-event-type="product-click" {{/if}} class="button button--small listItem-button quickview" data-product-id="{{id}}">{{lang 'products.quick_view'}}</button>
</div>
{{/if}}
{{/unless}}
Expand Down

0 comments on commit 7d57ec5

Please sign in to comment.