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

show-for() and hide-for() gap at exact width of breakpoint #10820

Closed
Lazerproof opened this issue Dec 23, 2017 · 4 comments
Closed

show-for() and hide-for() gap at exact width of breakpoint #10820

Lazerproof opened this issue Dec 23, 2017 · 4 comments

Comments

@Lazerproof
Copy link

How to reproduce this bug:

$breakpoints: (
      small: 0,
      medium: 568px,
      xxmedium: 940px,
      large: 1024px,
      xlarge: 1200px,
      xxlarge: 1440px,
);

.a {
  @include hide-for(xxmedium);
}

.b {
  @include show-for(xxmedium);
}

At 940px both element are visible. So implementation of hide-for() should be changed to $breakpoint-value - 1.

@ncoden ncoden self-assigned this Dec 23, 2017
@ncoden
Copy link
Contributor

ncoden commented Dec 23, 2017

Thank you @Lazerproof for your bug reports ;) .
I'm working on it.

@ncoden
Copy link
Contributor

ncoden commented Dec 23, 2017

See https://codepen.io/ncoden/pen/PEbGYR
This happens when the browser font-size is smaller than 16px. The gap of 1/16em (so 1px) between the two breakpoints become 0.625px and the max limit of the lower breakpoint is round to the upper pixel.

I'll search why the breakpoint sizes are set in em, and what unit we could use to fix this.

@JeremyEnglert
Copy link

@ncoden - think we can squeeze this into the upcoming release?

@ncoden
Copy link
Contributor

ncoden commented Jan 28, 2018

Yes. Fixing this issue would require to use pixels instead of em/rem for grids. This is a major change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants