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

Navbar has 1px gap where it's broken due to mixins.until subtracting 1px #3961

Open
FunctionDJ opened this issue Jan 17, 2025 · 0 comments
Open

Comments

@FunctionDJ
Copy link

Consider the following lines:

$navbar-breakpoint: iv.$desktop !default;

(with all defaults this value is 1024px)
@include mx.until($navbar-breakpoint) {

@include mx.from($navbar-breakpoint) {

Here's mixins.until:
@mixin until($device) {
@media screen and (max-width: ($device - 1px)) {
@content;
}
}

This all means that with all defaults, there is a gap between 1023px and 1024px where neither "desktop nav" nor "mobile nav" have display: block, breaking the navbar (no navigation possible, burger menu button visible but does seemingly nothing because mobile nav is hidden).

To be between these viewport sizes is easily possible:

  • 2560x1440px screen resolution
  • 125% OS-level scaling
  • snap browser window to side (half of screen)
  • chromium shows viewport width to be 1023.20px and nav is seemingly broken (hidden)

Suggested solution: Don't use mixins.until i guess..? Or maybe the - 1px can safely be removed and there won't be overlaps between the sets of styles.

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

No branches or pull requests

1 participant