Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(storefront): BCTHEME-373 Alt text not provided for ratings #1949

Merged
merged 2 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Alt text not provided for ratings. [#1949](https://github.com/bigcommerce/cornerstone/pull/1949)
- Carousel buttons do not receive focus. [#1937](https://github.com/bigcommerce/cornerstone/pull/1937)
- Empty cart message not read by screen reader. [#1935](https://github.com/bigcommerce/cornerstone/pull/1935)
- No tooltips provided for carousel buttons. [#1934](https://github.com/bigcommerce/cornerstone/pull/1934)
Expand Down
5 changes: 0 additions & 5 deletions assets/scss/components/stencil/productView/_productView.scss
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,6 @@
}
}

.productView-ratingWrapper {
display: inline-flex;
line-height: 1;
}

.productView-reviewLink {
display: inline-block;
margin-left: spacing("quarter");
Expand Down
27 changes: 16 additions & 11 deletions templates/components/amp/products/ratings.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{{#for 1 5}}
{{#if ../this.rating '>=' $index}}
<span class="icon icon--ratingFull">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="28" viewBox="0 0 26 28"><path d="M0 10.11q0-.58.875-.72L8.72 8.25l3.515-7.11Q12.532.5 13 .5t.767.64l3.516 7.11 7.844 1.14q.875.14.875.72 0 .343-.406.75l-5.672 5.53 1.344 7.812q.016.11.016.313 0 .328-.164.555t-.477.227q-.297 0-.625-.187l-7.016-3.687-7.016 3.687q-.344.187-.625.187-.327 0-.49-.227t-.165-.555q0-.094.03-.313L6.08 16.39.392 10.86q-.39-.423-.39-.75z"/></svg>
</span>
{{else}}
<span class="icon icon--ratingEmpty">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="28" viewBox="0 0 26 28"><path d="M0 10.11q0-.58.875-.72L8.72 8.25l3.515-7.11Q12.532.5 13 .5t.767.64l3.516 7.11 7.844 1.14q.875.14.875.72 0 .343-.406.75l-5.672 5.53 1.344 7.812q.016.11.016.313 0 .328-.164.555t-.477.227q-.297 0-.625-.187l-7.016-3.687-7.016 3.687q-.344.187-.625.187-.327 0-.49-.227t-.165-.555q0-.094.03-.313L6.08 16.39.392 10.86q-.39-.423-.39-.75z"/></svg>
</span>
{{/if}}
{{/for}}
<span role="img"
alt="{{lang 'products.reviews.rating_aria_label' current_rating=rating max_rating=5}}"
title="{{lang 'products.reviews.rating_aria_label' current_rating=rating max_rating=5}}"
>
{{#for 1 5}}
{{#if ../this.rating '>=' $index}}
<span class="icon icon--ratingFull">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="28" viewBox="0 0 26 28"><path d="M0 10.11q0-.58.875-.72L8.72 8.25l3.515-7.11Q12.532.5 13 .5t.767.64l3.516 7.11 7.844 1.14q.875.14.875.72 0 .343-.406.75l-5.672 5.53 1.344 7.812q.016.11.016.313 0 .328-.164.555t-.477.227q-.297 0-.625-.187l-7.016-3.687-7.016 3.687q-.344.187-.625.187-.327 0-.49-.227t-.165-.555q0-.094.03-.313L6.08 16.39.392 10.86q-.39-.423-.39-.75z"/></svg>
</span>
{{else}}
<span class="icon icon--ratingEmpty">
<svg xmlns="http://www.w3.org/2000/svg" width="26" height="28" viewBox="0 0 26 28"><path d="M0 10.11q0-.58.875-.72L8.72 8.25l3.515-7.11Q12.532.5 13 .5t.767.64l3.516 7.11 7.844 1.14q.875.14.875.72 0 .343-.406.75l-5.672 5.53 1.344 7.812q.016.11.016.313 0 .328-.164.555t-.477.227q-.297 0-.625-.187l-7.016-3.687-7.016 3.687q-.344.187-.625.187-.327 0-.49-.227t-.165-.555q0-.094.03-.313L6.08 16.39.392 10.86q-.39-.423-.39-.75z"/></svg>
</span>
{{/if}}
{{/for}}
</span>
5 changes: 0 additions & 5 deletions templates/components/products/product-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,7 @@ <h2 class="productView-brand"{{#if schema}} itemprop="brand" itemscope itemtype=
<meta itemprop="reviewCount" content="{{product.num_reviews}}">
{{/if}}
{{/if}}
<span class="productView-ratingWrapper"
title="{{lang 'products.reviews.rating_aria_label' current_rating=product.rating max_rating=5}}"
tabindex="0"
>
{{> components/products/ratings rating=product.rating}}
</span>
{{#if product.num_reviews '>' 0}}
<a href="{{product.url}}#product-reviews" id="productReview_link">
{{lang 'products.reviews.link_to_review' total=product.num_reviews}}
Expand Down
35 changes: 20 additions & 15 deletions templates/components/products/ratings.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{{#for 1 5}}
{{#if ../this.rating '>=' $index}}
<span class="icon icon--ratingFull">
<svg>
<use xlink:href="#icon-star" />
</svg>
</span>
{{else}}
<span class="icon icon--ratingEmpty">
<svg>
<use xlink:href="#icon-star" />
</svg>
</span>
{{/if}}
{{/for}}
<span role="img"
alt="{{lang 'products.reviews.rating_aria_label' current_rating=rating max_rating=5}}"
title="{{lang 'products.reviews.rating_aria_label' current_rating=rating max_rating=5}}"
>
{{#for 1 5}}
{{#if ../this.rating '>=' $index}}
<span class="icon icon--ratingFull">
<svg>
<use xlink:href="#icon-star" />
</svg>
</span>
{{else}}
<span class="icon icon--ratingEmpty">
<svg>
<use xlink:href="#icon-star" />
</svg>
</span>
{{/if}}
{{/for}}
</span>