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(core): ensure GridCardLink fills entire card #5017

Merged
merged 2 commits into from
Feb 25, 2021
Merged

fix(core): ensure GridCardLink fills entire card #5017

merged 2 commits into from
Feb 25, 2021

Conversation

delucis
Copy link
Contributor

@delucis delucis commented Feb 25, 2021

Summary

(This is tangentially related to #1341.)

When viewing a collection in grid view, if the entries don’t have images (or perhaps a custom summary), the cards are currently usually larger than the summary text. This results in poor UX, because only the upper part of the card actually contains the link element. Clicking in the lower part of the card won’t open the entry.

Screenshot showing the GridCardLink filling only part of an entry card

This PR adds height: 100% to the GridCardLink component, ensuring the link element always fills the full card height:

Screenshot showing the GridCardLink filling the full entry card

In addition, I have added outline-offset: -2px to ensure that outline styling on keyboard focus remains visible. The GridCard has overflow: hidden and so the default focus outline for the link would otherwise fall entirely outside the card. (Previously it was only visible on the bottom of the link as a horizontal line.) I had a look and couldn’t see any standard focus-styling approach being used, but I’m happy to change this offset approach as preferred.

Test plan

I have tested this change manually by running yarn start and checking its impact on cards with and without images and it appears to behave as expected. (Screenshots above show the before and after of the link sizing.)

A picture of a cute animal (not mandatory but encouraged)

A lynx to help us with these links.

A lynx

@delucis delucis requested a review from a team February 25, 2021 01:25
@erezrokah erezrokah added the type: bug code to address defects in shipped code label Feb 25, 2021
Copy link
Contributor

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

🚀 @delucis. Nice one!

@erezrokah erezrokah merged commit b7f91d7 into decaporg:master Feb 25, 2021
@delucis delucis deleted the delucis/core/card-link-ux branch February 25, 2021 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants