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

fix(page): fix section spacing #6766

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

srambach
Copy link
Member

@srambach srambach commented Jun 10, 2024

Fixes #6631

Moves padding/margin from the page__main-body to the page__main-section.
This requires page__main-body to be required.
Refactors the side margin spacing that had a TODO on it.
Also decreases the height of the examples when they are on the example page so that each one isn't taking up 100vh!

NOTE: To see what it looks like, it currently has 16px (md spacer) in as the space between rather than the 24 that was spec'd.

Backstop report with 24px: https://drive.google.com/file/d/1or9X7tbWaN3TFv41rKexfmS1oV_invdi/view?usp=sharing

@patternfly-build
Copy link

patternfly-build commented Jun 10, 2024

Copy link
Collaborator

@andrew-ronaldson andrew-ronaldson left a comment

Choose a reason for hiding this comment

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

We looked at this on a call and I think it looks good!

Copy link

@lboehling lboehling left a comment

Choose a reason for hiding this comment

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

i think this is looking good! do we need follow up issues to update our demos to use the new page-main-body sections?

@srambach
Copy link
Member Author

i think this is looking good! do we need follow up issues to update our demos to use the new page-main-body sections?

The update to the handlebars should be doing this.

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.

LGTM, left a few comments.

Comment on lines 82 to 86
// Page main body
--#{$page}__main-body--MarginBlockStart: 0;
--#{$page}__main-body--MarginBlockEnd: 0;
--#{$page}__main-body--PaddingInlineEnd: 0;
--#{$page}__main-body--PaddingInlineStart: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need these? As far as I can tell, doesn't look like they're ever modified. Padding is on the outer __main-[section/breadcrumbs/etc] and the spacing between __main-body sections is a gap.

Comment on lines 255 to 256
display: flex;
flex-direction: column;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since body is required now, wdyt about moving these styles to this block so all of the main-[whatever] sections (anything that has __main-body as children) have this style?

@@ -247,7 +254,6 @@ $pf-page-v6--height-breakpoint-map: build-breakpoint-map("base", "sm", "md", "lg
&.pf-m-limit-width {
display: flex;
flex-direction: column;
padding: 0;

> .#{$page}__main-body {
flex: 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can remove this? It's causing this issue of the parent section fills the available space, the main-body elements will all grow to fill the space

Screenshot 2024-06-14 at 10 45 58 AM

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.

This looks great! I'm assuming we want to include __main-body by default in all of the other types of page sections? With the possible exception of __main-group since it takes other sections as children. But I suppose we could add it there, too, to be consistent, if there are no side effects.

With v5, if a page had .pf-m-limit-width, we conditionally rendered __main-body and moved the padding from the outer section to the __main-body. WDYT about updating to just let the padding always remain on the outer section, and never move into the __main-body? That would allow us to simplify the CSS quite a bit. It would mean that within __main-body on a width limited section, there would be no padding-inline-end, but that should be fine. It would create a slight difference in the available space for content in a width limited section compared to v5 (more space in v6 since the padding-inline-end isn't on the inner __main-body with the max-width), but that seems fine to me.

Comment on lines 343 to 347
.#{$page}__main-list {
display: flex;
flex-direction: column;
flex-grow: 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can take this out now? I only see it in the hackathon demo code.

Comment on lines 431 to 432
display: flex;
flex-direction: column;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove this since you added it here

.#{$page}__main-nav,
.#{$page}__main-breadcrumb,
.#{$page}__main-tabs,
.#{$page}__main-section,
.#{$page}__main-wizard,
.#{$page}__main-group,
.#{$page}__main-subnav {
display: flex;
flex-direction: column;
flex-shrink: 0;

Comment on lines 498 to 500
.#{$page}__main-nav & {
padding-block-start: var(--#{$page}__main-nav--PaddingBlockStart);
padding-inline-start: var(--#{$page}__main-nav--PaddingInlineStart);
padding-inline-end: var(--#{$page}__main-nav--PaddingInlineEnd);
Copy link
Contributor

Choose a reason for hiding this comment

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

pretty sure you can remove this, it was for tertiary nav, which we removed since it was replaced with horizontal subnav, and we use .#{$page}__main-subnav for horizontal subnav.

--#{$page}__main-section--PaddingBlockEnd: 0;
--#{$page}__main-section--PaddingInlineStart: calc(var(--pf-t--global--spacer--lg) - var(--#{$page}__main-container--BorderWidth)); // subtract the border of the main section
--#{$page}__main-section--PaddingBlockStart: var(--pf-t--global--spacer--md);
--#{$page}__main-section--PaddingInlineEnd: var(--pf-t--global--spacer--lg); // This is the intended spacing - the border of the main section will be subtracted
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 love the update to hold the actual spacer here. Much better for customization.

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!

@mcoker mcoker merged commit 82ebaf8 into patternfly:v6 Jun 17, 2024
4 checks passed
@patternfly-build
Copy link

🎉 This PR is included in version 6.0.0-alpha.162 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mcoker
Copy link
Contributor

mcoker commented Jun 17, 2024

Followup for the add'l stuff - #6801

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.

[PageSection] - change padding for adjacent page sections with the same background color
5 participants