Skip to content

Commit

Permalink
quick view button focusable
Browse files Browse the repository at this point in the history
  • Loading branch information
yurytut1993 committed Nov 11, 2020
1 parent 1e897b4 commit 742c64a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
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
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"productpage_related_products_count": 10,
"productpage_similar_by_views_count": 10,
"categorypage_products_per_page": 12,
"shop_by_price_visibility": true,
"shop_by_price_visibility": false,
"brandpage_products_per_page": 12,
"searchpage_products_per_page": 12,
"show_product_quick_view": true,
Expand All @@ -86,7 +86,7 @@
"show_custom_fields_tabs": false,
"show_product_weight": true,
"show_product_dimensions": false,
"product_list_display_mode": "grid",
"product_list_display_mode": "list",
"logo-position": "center",
"logo_size": "250x100",
"logo_fontSize": 28,
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 {{#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 742c64a

Please sign in to comment.