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): change breakpoint to fix bug #1918

Merged
merged 2 commits into from
Jun 13, 2019

Conversation

christiemolloy
Copy link
Member

fix #1917

When I remove 1px from the breakpoint it fixes the issue of top: var(--pf-c-page__header-nav--c-nav__scroll-button--lg--Top); and background-color: var(--pf-c-page__header-nav--c-nav__scroll-button--lg--BackgroundColor); being assigned too early and causing a bug.

This also fixes the nav background-color changing to transparent before it is used for the background color of the scroll buttons.

I think its happening because the grid in the header nav changes at a minimum breakpoint of lg, and these assignments are happening at a maximum breakpoint of lg, although I can't fully pinpoint the issue. @mcoker wondering if you have any insight into this?

@patternfly-build
Copy link

patternfly-build commented Jun 11, 2019

Deploy preview for pf-next ready!

Built with commit acbeecc

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

@mattnolting mattnolting self-requested a review June 12, 2019 17:19
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.

I think its happening because the grid in the header nav changes at a minimum breakpoint of lg, and these assignments are happening at a maximum breakpoint of lg, although I can't fully pinpoint the issue. @mcoker wondering if you have any insight into this?

That's exactly the problem. Anytime we use max-width we should be using $breakpoint - 1. Otherwise we'll start running into these breakpoint collisions. It's probably wise to create a new set of variables for this.

$pf-global--max-width--breakpoint--sm: $pf-global--breakpoint--sm - 1;
$pf-global--max-width--breakpoint--md: $pf-global--breakpoint--md - 1; 
$pf-global--max-width--breakpoint--lg: $pf-global--breakpoint--lg - 1;
$pf-global--max-width--breakpoint--xl: $pf-global--breakpoint--xl - 1; 
$pf-global--max-width--breakpoint--2xl: $pf-global--breakpoint--2xl - 1; 

But for bug fix, the inline calc makes sense.

@mcoker thoughts?

@@ -240,7 +240,7 @@
min-width: 0;

.pf-c-nav__scroll-button {
@media screen and (max-width: $pf-global--breakpoint--lg) {
@media screen and (max-width: 991px) {
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 use a subtraction operator here #{$pf-global--breakpoint--lg - 1}?

@mattnolting mattnolting merged commit 64ece13 into patternfly:master Jun 13, 2019
@patternfly-build
Copy link

🎉 This PR is included in version 2.12.8 🎉

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.

3 participants