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

Fix product card accessibility #589

Merged
merged 6 commits into from
Sep 16, 2021
Merged

Conversation

tauthomas01
Copy link
Contributor

@tauthomas01 tauthomas01 commented Sep 8, 2021

Why are these changes introduced?

Fixes #450

The goal of this PR is to fix the accessibility issues on product card component.

Best way to code review is to hide whitespaces.
alt

What approach did you take?

  • Removed visually-hidden product title
  • Re-arrange "card information" and "card media" markup structure, used flexbox and reverse the order.
  • Remove aria-hidden for badges

This affect Collage section (product) and product card component (featured collection section, collection page)

Other considerations

Demo links

Checklist

@tauthomas01 tauthomas01 marked this pull request as ready for review September 8, 2021 15:49
@svinkle
Copy link
Member

svinkle commented Sep 8, 2021

@tauthomas01, this is looking good. Thoughts on using :focus-within to reapply the large focus ring to the whole card?

@tauthomas01
Copy link
Contributor Author

Hi @svinkle, thank you for the review. I added the focus state on the whole card now

svinkle
svinkle previously approved these changes Sep 9, 2021
@svinkle
Copy link
Member

svinkle commented Sep 9, 2021

@tauthomas01 Curious does this apply to all "cards" throughout? I also called out the blog card in #452.

@tauthomas01
Copy link
Contributor Author

tauthomas01 commented Sep 9, 2021

@svinkle Good question, this change applies on

  • featured collection
  • collection template
  • search result
  • product recommendation
  • collage section

For the blog card, I will handle in a separate PR.

@svinkle
Copy link
Member

svinkle commented Sep 15, 2021

@tauthomas01 Any timeline on merging this? I need to have this component tested with Fable on a separate issue, but would prefer these changes to be merged and available during testing.

@tauthomas01
Copy link
Contributor Author

@svinkle I'll need some devs to review this, I'll get back to you shortly.

snippets/product-card.liquid Show resolved Hide resolved
assets/component-card.css Show resolved Hide resolved
snippets/product-card.liquid Show resolved Hide resolved
ludoboludo
ludoboludo previously approved these changes Sep 16, 2021
Copy link
Contributor

@ludoboludo ludoboludo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small comment otherwise seems good to me 👌

{%- else -%}
<div class="card__content">
<h2 class="card__text h3">
<a href="{{ product_card_product.url | default: '#' }}" class="full-unstyled-link">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing here, I wonder if the price part should be part of the link as well 🤔 ?
video

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw on other product cards with image that when you have prices and vendor, it's also highlighting so I made the changes: https://screenshot.click/16-34-8qevw-au1v7.mp4

svinkle
svinkle previously approved these changes Sep 16, 2021
@tauthomas01 tauthomas01 dismissed stale reviews from svinkle and ludoboludo via e4ad151 September 16, 2021 18:36
@@ -42,6 +42,10 @@
justify-content: center;
}

.card--text-only.card--product {
position: static;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A side effect, which I think is nice, is that on mobile when you click on the card it now only highlights the product title rather that the whole product card.

@tauthomas01
Copy link
Contributor Author

@svinkle , I made a small change (#589 (comment))

Whenever you're ready to approve, I can merge this

@svinkle
Copy link
Member

svinkle commented Sep 16, 2021

@tauthomas01 Sorry, I'm not sure what this refers to. What was changed?

@tauthomas01
Copy link
Contributor Author

@tauthomas01 Sorry, I'm not sure what this refers to. What was changed?

On product card with no image, when you hover the price, the link is clickable. Previously, when you hover the price, we were seeing the hover state, but the link was not clickable.

@svinkle
Copy link
Member

svinkle commented Sep 16, 2021

@tauthomas01 Gotcha. Looks good! 👍

@tauthomas01 tauthomas01 merged commit 8c55375 into main Sep 16, 2021
@tauthomas01 tauthomas01 deleted the fix-product-card-accessibility branch September 16, 2021 20:37
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* Fix accessibility for product cards

* remove default heading space

* Fix collage

* add focus on card hover

* fixed no media case + spacing on collage

* include links to the whole product card with no media
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Featured Product] Card link generates overly verbose user experience
3 participants