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

chore(info-card): clean up info card example #190

Merged
merged 8 commits into from Nov 16, 2017

Conversation

seanforyou23
Copy link
Contributor

This pull request improves the display of the example for the info status card component. What was previously thought to be a core styling issue with the info card, was realized to be caused by an issue with the way the example markup was structured.

This may invalidate the need for adjusting the top/bottom margin at the core card component level - which is mentioned in a related ticket.

Use better example image that has intrinsic demensions, re-structure
example markup to improve samples
@seanforyou23
Copy link
Contributor Author

Also, I don't seem to have permissions to assign reviewers. Is there any way someone could turn this on for me? Thx!

@LHinson
Copy link
Member

LHinson commented Nov 8, 2017

@seanforyou23 I've added as a member of the pf-ng maintainers team to address this issue!

@dlabrecq
Copy link
Member

dlabrecq commented Nov 8, 2017

Can you please add a link to your rawgit example? A snapshot would also be helpful.

Copy link
Member

@dlabrecq dlabrecq left a comment

Choose a reason for hiding this comment

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

The padding at the bottom looks good, but we may swant to restrict the length of the card more? When the window is expanded, the card looks off.

screen shot 2017-11-08 at 8 57 16 am

@dlabrecq
Copy link
Member

dlabrecq commented Nov 8, 2017

As I shrink the window to the left, the card with jumps wide again. It appears the layout is using col-md-6, then jumps to 8 columns using col-sm-8.

Before:
screen shot 2017-11-08 at 9 01 55 am

After:
screen shot 2017-11-08 at 9 02 09 am

seanforyou23 added a commit to seanforyou23/patternfly that referenced this pull request Nov 9, 2017
address scenario where card width is too small which causes textual content to overflow the bounds
of the card

patternfly/patternfly-ng#190
@seanforyou23
Copy link
Contributor Author

@dgutride thanks for the feedback.

Sorry I forgot to post a link to the rawgit! Here it is;

https://rawgit.com/seanforyou23/patternfly-ng/info-card-example-dist/dist-demo/#/infocard

For restricting the length of the card - this is impacted by the container that houses the card examples. Because the primary container uses the class "container-fluid", even the smallest practical large column class (col-lg-3) ends up with extra space when expanding the browser window to a point. Was able to get around this by simply setting a max-width on a parent container, this is essentially what's happening in the angular-patternfly example.

Below is a screenshot of what it now looks like on large viewports.

screen shot 2017-11-09 at 3 48 30 pm

Let me know if you find anything else that needs attention. Thanks!!

Copy link
Member

@AdamJ AdamJ left a comment

Choose a reason for hiding this comment

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

There is also an issue on the following class that is causing the content of your card to bleed out into the well:

.card-pf-info-status {
  display: flex;
}

In order to prevent bleed-through, it should be updated to be

.card-pf-info-status {
  display: inline-flex;
}

<div class="padding-15">
<div class="row row-cards-pf well">
<div style="max-width:409px;">
<div class="col-md-10">
Copy link
Member

Choose a reason for hiding this comment

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

Change this to <div class="col-sm-8 col-md-7">

</div>
<div class="padding-15">
<div class="row row-cards-pf well">
<div style="max-width:409px;">
Copy link
Member

Choose a reason for hiding this comment

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

This is conflicting with the column width that you have set below. In the "medium" viewport, you are making the card smaller than the column wants it to be.

I would delete this line, and change the column styles on the next. (see below)

<div class="cards-pf">
<div class="row row-cards-pf">
<div class="col-sm-4">
<br>
Copy link
Member

Choose a reason for hiding this comment

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

Instead of using <br>, you can make each card it's own row. That will give proper spacing and allow for responsiveness on resizing of the viewport.

@seanforyou23
Copy link
Contributor Author

@mindreeper2420 thanks for pointing that out, I was actually struggling with confirming what was the best way of addressing the overflow. After speaking with a few other devs I realized I had an issue with the markup I was using which was complicating things. Setting the card to inline-flex ends up causing other layout issues so I wasn't able to use that method, however word-break solved it nicely and didn't affect the surrounding page elements. Anyway, it's ready for another review when you have time. Thx!

}
}
.cards-pf {
padding-bottom: 20px;
Copy link
Member

Choose a reason for hiding this comment

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

with View.Encapsulation: None;, this may pose a problem with styles being injected into the <head> of the site.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a good point, thanks @mindreeper2420 - I've prefixed the example selectors with a class which is specific to the info status card example, this should keep any conflict from arising.

padding-bottom: 20px;
}
.cards-pf .row-cards-pf {
margin-bottom: @bottomMargin;
Copy link
Member

Choose a reason for hiding this comment

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

same here with View Encapsulation

Copy link
Member

Choose a reason for hiding this comment

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

Since this is a single page app, it only effects this particular card example, but we should use best practices.

We can add a level of specificity by applying the margins/padding to restrictive-width-example-container and fluid-width-example-container, for example.

…s with selector that is specific to info status card example
Copy link
Member

@dlabrecq dlabrecq left a comment

Choose a reason for hiding this comment

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

LGTM. Great job!

@AdamJ
Copy link
Member

AdamJ commented Nov 16, 2017

LGTM too! Thanks for making the updates!

@dlabrecq dlabrecq merged commit 39fe2d9 into patternfly:master Nov 16, 2017
@seanforyou23 seanforyou23 deleted the info-card-example branch November 16, 2017 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants