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

feat(card): add pf-m-display-lg and pf-m-rounded #5389

Merged
merged 7 commits into from
Feb 2, 2021

Conversation

redallen
Copy link
Contributor

@redallen redallen commented Jan 27, 2021

What: Closes #5334

Additional issues: I made an interactive modifiers example to showcase it

@patternfly-build
Copy link
Contributor

patternfly-build commented Jan 27, 2021

KKoukiou
KKoukiou previously approved these changes Jan 28, 2021
Copy link
Collaborator

@KKoukiou KKoukiou left a comment

Choose a reason for hiding this comment

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

Nice parametrization of the examples code @redallen!

Your change it of course totally fine codewise, I just wonder why PF wants to expose to its consumers that isRounded property. It causes a really subtle difference, and I feel that the PF designers should decide if the cards should have rounded corners or not and not let the consumers make decisions about it.

After all, the reason that we all use PF and not custom styling is in order that all RH products have the same Ui experience.

So, this PR is fine to go in but I really don't see the usecase for it.

@redallen
Copy link
Contributor Author

@KKoukiou This thread has the context behind pf-m-rounded: patternfly/patternfly#3670 . I'd ask @mcarrano its purpose.

@mcarrano
Copy link
Member

You ask a valid question @KKoukiou . This originated from the web properties design team wanting to use PatternFly to present more marketing oriented content. @mmenestr do you know if we have plans to add this guidance to our design guidelines for Cards? I agree that we don't want designers to just arbitrarily pick styling. Products and web applications should stick with the squared corners.

@mmenestr
Copy link
Collaborator

@mcarrano I don't believe we do. This is the first I've heard of this! Just to make sure I have the info right, is it just a modifier to give cards the capability of having rounded edges? And we want to recommend that this only be done for marketing purposes and that products keep using non-rounded cards?

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

isLarge and isCompact shouldn't be used together - do we need to do anything special for that?

@redallen
Copy link
Contributor Author

redallen commented Feb 1, 2021

@mcoker Unfortunately since we've already released isCompact there isn't much we can do. I've added a warning and will default to isCompact if both are specified.

@kmcfaul
Copy link
Contributor

kmcfaul commented Feb 1, 2021

Can we also add something to both prop descriptions (isLarge and isCompact) for clarity? Like Should not be used together with {X}. Or maybe the console warning is enough?

@redallen
Copy link
Contributor Author

redallen commented Feb 1, 2021

@kmcfaul I added that to the prop description.

mcoker
mcoker previously approved these changes Feb 1, 2021
Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

L👍TM!

Copy link
Contributor

@jessiehuff jessiehuff left a comment

Choose a reason for hiding this comment

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

I really like the modifier example! It's really neat to be able to play with all of the different modifiers. Can we add the keyboard interaction to the selectable example though? I currently can't select it by keyboard or screen reader the way I could with the previous selectable example. (I'm hoping that by adding the keyboard interaction, it'll work through screen reader as well.)

@redallen
Copy link
Contributor Author

redallen commented Feb 1, 2021

@jessiehuff I've removed the isSelectable and isSelected to avoid confusion and keep the demo simple.

mcarrano
mcarrano previously approved these changes Feb 1, 2021
Copy link
Member

@mcarrano mcarrano left a 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. Thanks @redallen .

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

looks good. Can you just update the demo app and add test for new props.

ouiaId,
ouiaSafe = true,
...props
}: CardProps) => {
const Component = component as any;
const ouiaProps = useOUIAProps(Card.displayName, ouiaId, ouiaSafe);
if (isCompact && isLarge) {
// eslint-disable-next-line no-console
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a test for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

@kmcfaul kmcfaul merged commit 2adb463 into patternfly:master Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Large card variant
9 participants