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(nav): fix horizontal nav spacing, background color #1798

Merged
merged 1 commit into from
May 21, 2019

Conversation

mcoker
Copy link
Contributor

@mcoker mcoker commented May 3, 2019

fixes #1794, fixes #1797

@patternfly-build
Copy link

Deploy preview for pf-next ready!

Built with commit 03f9f27

https://deploy-preview-1798--pf-next.netlify.com

--pf-c-page__header-nav--lg--PaddingLeft: 0;
--pf-c-page__header-nav--lg--MarginLeft: var(--pf-global--spacer--xl);
--pf-c-page__header-nav--lg--MarginRight: var(--pf-global--spacer--xl);
--pf-c-page__header-nav--BackgroundColor: var(--pf-global--BackgroundColor--dark-transparent-100);
--pf-c-page__header-nav--BackgroundColor: #242424; // Custom color for this element only
--pf-c-page__header-nav--lg--BackgroundColor: transparent;
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to set this variable, could you change the breakpoint to max-width and just set the background color there. I know its a breaking change but maybe we could create an issue to remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't matter to me. It's probably the same amount of code either way - you're losing a variable but adding a media query. This way is technically more flexible, too, not that we need it to be. Feel free to create an issue if you think we should remove it.

Copy link
Member

Choose a reason for hiding this comment

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

Thats ok then

@@ -224,12 +232,23 @@
.pf-c-page__header-nav {
grid-column: 1 / -1;
grid-row: 2 / 3;
min-width: 0;
Copy link
Member

Choose a reason for hiding this comment

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

Is the min-width just for FF?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, it breaks in chrome without it, too. the default is min-width: min-content; so by default, the header-nav element doesn't overflow and just grows to fit it's content. That causes the nav and masthead to grow too wide, resulting in this brokenness.

Screen Shot 2019-05-17 at 9 31 53 AM

Copy link
Member

Choose a reason for hiding this comment

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

ok great

--pf-c-page__header-nav--lg--BackgroundColor: transparent;
--pf-c-page__header-nav--c-nav__scroll-button--nth-of-type-1--Left: calc(-1 * (var(--pf-global--spacer--md) - var(--pf-global--spacer--xs))); // This sets the the button to the edge of its container with 4px clearance on the left
--pf-c-page__header-nav--c-nav__scroll-button--nth-of-type-1--md--Left: calc(-1 * (var(--pf-global--spacer--md) - var(--pf-global--spacer--xs)));
Copy link
Member

Choose a reason for hiding this comment

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

Should we also do this to the 2nd button to make padding balanced on both sides

Screen Shot 2019-05-13 at 9 56 26 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To do that, if we move the button to the left a little, I think we'll need to add right padding to the horizontal nav so that the nav links don't show on the right side of the button (behind/underneath the button, since the nav extends to the right edge of the page). That would probably be a breaking change for folks who don't have the overflow buttons enabled, since their nav would no longer cut off/overflow to the edge of the browser and would cut off at the padding instead. But if we're OK with the way this looks for folks that don't have the overflow buttons enabled, I think that's a good change.

What do you think @kybaker, is this OK?

Screen Shot 2019-05-17 at 9 28 13 AM

FWIW, this is what it looks like currently.

Screen Shot 2019-05-17 at 9 29 42 AM

Copy link

Choose a reason for hiding this comment

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

@mcoker I do not think we want padding here. It looks like a bug and it is not as clear that there is overflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good thanks @mcoker

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.

NICE WORK

@christiemolloy christiemolloy merged commit adf4add into patternfly:master May 21, 2019
@patternfly-build
Copy link

🎉 This PR is included in version 2.6.15 🎉

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.

4 participants