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

4.x - Create a card component #696

Closed
14 tasks done
pyrello opened this issue May 25, 2022 · 10 comments · Fixed by #698
Closed
14 tasks done

4.x - Create a card component #696

pyrello opened this issue May 25, 2022 · 10 comments · Fixed by #698
Assignees
Labels
4.x 4.x version

Comments

@pyrello
Copy link
Contributor

pyrello commented May 25, 2022

Motivation

Create a card component to handle what we were using the card for in 3.x.

Proposed solution

How are we going to reference different card sub elements (media, title, details, etc.) style-choices?
Elements

Options

  • Outline
  • Stacked/Alignment
    • change the orientation of the default card, without the stacked class, to be horizontal.
  • Content alignment
  • Background
  • 4.x - Add card button alignment options #709 - We are going to handle this in a follow-up issue.
@pyrello pyrello added the 4.x 4.x version label May 25, 2022
@pyrello
Copy link
Contributor Author

pyrello commented May 25, 2022

This article is the origin of the media object concept, which is the inspiration for the card component in UIDS (and HDS before that): http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/

We also had a fair amount of review of existing component libraries and discussion around the decisions we made about how to structure them, but that was all lost when the HDS repo was removed :(

@pyrello
Copy link
Contributor Author

pyrello commented May 26, 2022

I think when we built the original card, we used Material Design as a bit of an inspiration. They have a new version now: https://m3.material.io/components/cards/overview

Here is the original: https://material.io/components/cards

@bspeare
Copy link
Contributor

bspeare commented May 27, 2022

Here is one change I would be interested in making in 4.x.

@pyrello
Copy link
Contributor Author

pyrello commented May 27, 2022

Change card--enclosed to a general utility class that can be used on other components?

Dropping this here for reference: https://getbootstrap.com/docs/5.2/components/card/#border. Bootstrap's cards have borders by default and don't seem to have a way to turn them off without overriding their styles, so this is not exactly the model we want to be following, but using a mixin to add border style options is something we could figure out how to do.

(edit) Here is the section in the MD V3 guide on cards about the outline card: https://m3.material.io/components/cards/specs#9ad208b3-3d37-475c-a0eb-68cf845718f8 What I thought was interesting about this was the option to have a fill color and an outline. This is kind of similar to how we are doing buttons.

@briand44
Copy link

briand44 commented Jun 7, 2022

Sean can share what work has been started with whoever takes this on.

@briand44
Copy link

briand44 commented Jun 7, 2022

could be a good issue to pair/swarm

@pyrello
Copy link
Contributor Author

pyrello commented Jun 12, 2022

Here are a couple changes that were suggested during conversation on Friday:

  • Move any .card__title styles to .card .headline.
  • Move and rename .card__subtitle and .card__meta to be text style utility classes, possibly prefixed with .text--.

@pyrello pyrello assigned pyrello and GaryRidgway and unassigned pyrello Jun 14, 2022
@GaryRidgway
Copy link
Contributor

Capturing from our conversation about a path forward to get this first draft to a state we feel comfortable leaving it in.

  • Clean up sass file
  • Collision for media padded and borderless, used in combo media padding doesn’t do anything.
  • Media padded on L/R align is not working.

@bspeare
Copy link
Contributor

bspeare commented Jun 23, 2022

Should we close this issue and create follow-up issues?

@pyrello
Copy link
Contributor Author

pyrello commented Jun 27, 2022

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.x version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants