uiowa / uids

UI Design System
http://uids.brand.uiowa.edu
7 stars 1 forks source link

4.x - Add "cover" as a shape option for card component #804

Open bspeare opened 1 year ago

bspeare commented 1 year ago

As a user of the card component, I would like to stretch my card image to fill the vertical space of the card using the "cover" shape option that applies the object-fit property.

Proposed solution

Shape

With padded

Screen Shot 2022-10-20 at 12 48 05 PM

Without padded

Screen Shot 2022-10-20 at 12 48 35 PM

You can preview this functionality in https://github.com/uiowa/uids/pull/803.

joewhitsitt commented 1 year ago

Do we want to entertain the idea of a widescreen vs square "shape" cover or am I not thinking responsively?

bspeare commented 1 year ago

@joewhitsitt Yes, that could be a good idea!

joewhitsitt commented 1 year ago

I guess I can visualize the square cover compared to the default cover screenshot above, but I am not sure what a widescreen cover would look like since the height would be determined by the card content.

bspeare commented 1 year ago

That's true. A widescreen ratio quickly becomes something else once the card fills up with text:

Screen Shot 2022-10-21 at 8 43 49 AM

Perhaps promising the aspect ratio as part of the cover is not the best solution.