-
Notifications
You must be signed in to change notification settings - Fork 95
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(card): introduce large card variant #3793
Conversation
Preview: https://patternfly-pr-3793.surge.sh A11y report: https://patternfly-pr-3793-coverage.surge.sh
|
@mcarrano @mceledonia should this follow the variation naming we introduced for the tile and CTA button ( |
| `.pf-m-no-fill` | `.pf-c-card__body` | Sets a `.pf-c-card__body` to not fill the available space in `.pf-c-card`. `.pf-m-no-fill` can be added to multiple card bodies. | | ||
| `.pf-m-hoverable` | `.pf-c-card` | Modifies the card to include hover styles on `:hover`. | | ||
| `.pf-m-selectable` | `.pf-c-card` | Modifies a selectable card so that it is selectable. | | ||
| `.pf-m-selected` | `.pf-c-card.pf-m-selectable` | Modifies a selectable card for the selected state. | | ||
| `.pf-m-flat` | `.pf-c-card` | Modifies the card to have a border instead of a shadow. `.pf-m-flat` is for use in layouts where cards are against a white background. | ||
| `.pf-m-flat` | `.pf-c-card` | Modifies the card to have a border instead of a shadow. `.pf-m-flat` is for use in layouts where cards are against a white background. | | ||
| `.pf-m-rounded` | `.pf-c-card` | Modifies the card to for the rounded corner. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `.pf-m-rounded` | `.pf-c-card` | Modifies the card to for the rounded corner. | | |
| `.pf-m-rounded` | `.pf-c-card` | Modifies the card to have rounded corners. | |
--pf-c-card--m-large--child--PaddingBottom: var(--pf-global--spacer--xl); | ||
--pf-c-card--m-large--child--PaddingLeft: var(--pf-global--spacer--xl); | ||
--pf-c-card--m-large--c-divider--child--PaddingTop: var(--pf-global--spacer--xl); | ||
--pf-c-card--m-large__title--not--last-child--PaddingBottom: var(--pf-global--spacer--lg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at these designs, it looks like the header/title should have the --xl
spacer.
In the card, the title and header are somewhat synonymous as far as the spacing is concerned. The header is just used to wrap the title if you have other things you want to put adjacent to the title. In the examples in the design, there is a "title" but that looks to just be a generic title, not necessarily the card's title element. Do you see it differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcoker Sorry for not noticing that! Thank you, will update.
@mcoker I'm OK to call this "Large" for lack of a better name unless @mceledonia or @ajacobs21e have a better idea. |
Large sounds good to me. The only other thing I could think of is something like 'web' or 'marketing' but they're too specific. |
@mcarrano @ajacobs21e thanks! Just to clarify, the variation is currently called However, when we introduced the CTA button, we decided to introduce a We also used Following that, I'm assuming it makes sense to call this variation |
@mcoker That makes sense to me in terms of being consistent. I do think it would make sense to just have more generic large variations without implying a use case with the name, that seems like something better suited for documentation. I would say given that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Well done @DaoDaoNoCode! 🚢 it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but @mceledonia can you also take a look?
As an aside, I don't understand why the card variants/examples don't show in the right-hand POC for this page as they do for other components.
@redallen do you know why that is? Seems like if you have more than 23 h3's, all of them disappear. |
@mcoker Bump theme-patternfly-org and this should be fixed. I think the limit used to be 25 items total per design. |
@mcarrano @gdoyle1 @ajacobs21e I am definitely late to the party here, but reviewing this I got confused by the usage of the title section. In the design examples above, there are various examples where the card header is in the body section, when I would expect it to be in the title section. I was always under the impression that the title/header section of the card was primarily for this purpose. I see the use case for an icon/image there, shown in another example, but I can see this getting confusing for users when trying to understand what to use the title section for (why not the actual title/header?). In other words, I would expect the title section to be used for titles/headers/images, and the font size of the text inside that area to reflect that (larger than body font as seen in designs) I first noticed this when I noticed the mismatch of font sizes in the implementation of header/body. The header section has a 16px font size and the body has 18px, which doesn't match the designs at first glance. Any insight on the decision to use headers in the body section as seen above? --- quick edit I think we should try to provide some standardization for these, some consistency within our examples and documentation even though we don't actually limit what can live in those sections from a technical perspective. |
@mceledonia I think the problem was that the spacing between the header and body was changing throughout the examples that the web team had. There was a new-ish part of the card, which was optional, which is the image/video. And then sometimes a title was placed in but didn't span across the whole card, and the spacing between the title and body often changed. I'm good with going with whatever you suggest to standardize them all. I think it would just require us to make sure the spacer used btwn title and body is consistent |
--pf-c-card--m-display-lg--child--PaddingBottom: var(--pf-global--spacer--xl); | ||
--pf-c-card--m-display-lg--child--PaddingLeft: var(--pf-global--spacer--xl); | ||
--pf-c-card--m-display-lg--c-divider--child--PaddingTop: var(--pf-global--spacer--xl); | ||
--pf-c-card--m-display-lg__title--not--last-child--PaddingBottom: var(--pf-global--spacer--xl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--pf-c-card--m-display-lg__title--not--last-child--PaddingBottom: var(--pf-global--spacer--xl); | |
--pf-c-card--m-display-lg__title--not--last-child--PaddingBottom: var(--pf-global--spacer--lg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaoDaoNoCode confirmed with @mceledonia that everything should have an xl
spacer except the space below the title, that should be lg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LPTM🎉
🎉 This PR is included in version 4.80.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #3670