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(modal): added align-top variation #3435

Merged
merged 1 commit into from Sep 10, 2020
Merged

Conversation

mcoker
Copy link
Contributor

@mcoker mcoker commented Aug 26, 2020

Documentation - https://patternfly-pr-3435.surge.sh/documentation/core/components/modalbox

Demo - https://patternfly-pr-3435.surge.sh/documentation/core/demos/modal/top-aligned


fixes #3405

After looking at this some more, I think introducing a dialog layout would be too much hassle than it's worth at this point. We can just reposition the modal within the bullseye for now, and that should work fine. In an upcoming breaking change release we can re-evaluate and refactor the modal-box just to be a box and move all of the positioning, max-widths/heights, etc from it to the modal to a dialog layout.

I also evened out the outer spacing for this variation so that the top/bottom/left/right spacing around the modal is all the same.

Screen Shot 2020-08-26 at 11 53 16 AM

Screen Shot 2020-08-26 at 11 53 11 AM

@patternfly-build
Copy link

patternfly-build commented Aug 26, 2020

Preview: https://patternfly-pr-3435.surge.sh

CSS Size Report
NameCurrentPreviousDiff %
components/ModalBox/modal-box.css6.2 kB5.4 kB13.60
patternfly.min.css717.8 kB717.1 kB0.11
patternfly-no-reset.css811.9 kB811.0 kB0.10
patternfly.css813.8 kB812.9 kB0.10

A11y report: https://patternfly-pr-3435-coverage.surge.sh

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.

This looks good to me @mcoker .

@ziccardi @garrett Can you review and confirm that this will address your original ask here: patternfly/patternfly-design#890

@garrett
Copy link

garrett commented Aug 31, 2020

I don't know how I can check this in Cockpit or even see an isolated demo page... but when looking at the code and the screenshots, it looks like the dialog modification in this PR is stretched to the content area?

We don't need all of our dialogs to be as large as possible. Although, I guess, these larger fullscreen dialogs might be useful for some — and perhaps even for us too, if we designed for it. (This might especially be the case if we had a way to toggle between normal and maximized mode, I guess?)

What we definitely need: Dialogs that can be positioned relative to the top, so:

  1. when content changes it doesn't move all the widgets
  2. dialogs are more properly balanced, as they're aligned downward due to being middle-aligned in an iframe (so the heading isn't accounted for, and it shoves everything further down)

Context of the issues we're facing with the currently center-aligned dialogs in Cockpit @ patternfly/patternfly-design#890 (with screenshots)

@mcoker
Copy link
Contributor Author

mcoker commented Aug 31, 2020

@garrett if my guess at the markup is correct, this is what the top-aligned modal in this PR will look like in a patternfly page where the content in the main section is an iframe - https://codepen.io/mcoker/pen/NWNvpqp

I just added the top-aligned example from https://patternfly-pr-3435.surge.sh/documentation/core/demos/modal/top-aligned as inline code for the iframe, with a <link> to the stylesheet from that PR. How does that look?

@garrett
Copy link

garrett commented Sep 1, 2020

@mcoker: Oh! That would look nice.

I was thrown off by the isFullscreen and the screenshots... which I guess are large because of the content.

(I wonder if there's a way to view branches of PF in Cockpit. Perhaps @KKoukiou or @martinpitt might know.)

Copy link
Contributor

@mattnolting mattnolting left a comment

Choose a reason for hiding this comment

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

LPTM 👍

@ziccardi
Copy link

ziccardi commented Sep 8, 2020

LGTM 👍

Copy link
Member

@christiemolloy christiemolloy left a comment

Choose a reason for hiding this comment

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

i've seen some product designs that used patternfly in the past position their modal at the very top of the page without the margin. I could definitely see this being a use case, because right now it looks like its floating especially at xl size. do you think we should support this use case?

Screen Shot 2020-09-08 at 3 43 40 PM

@mcoker
Copy link
Contributor Author

mcoker commented Sep 8, 2020

cc @mcarrano wdyt about christie's comment, should we offer a top variation with no margin

@mcarrano
Copy link
Member

mcarrano commented Sep 8, 2020

i've seen some product designs that used patternfly in the past position their modal at the very top of the page without the margin. I could definitely see this being a use case, because right now it looks like its floating especially at xl size. do you think we should support this use case?

I'm inclined to say no, @mcoker @christiemolloy . But what do you think, @mceledonia ?

Copy link
Member

@christiemolloy christiemolloy left a comment

Choose a reason for hiding this comment

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

lgtm! we can always add a variation for the modal to sit at the very top later

@mcoker mcoker merged commit 65b5ccd into patternfly:master Sep 10, 2020
@redallen
Copy link
Contributor

🎉 This PR is included in version 4.39.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Modal: Add option for top-positioning
8 participants