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

Responsive hide classes issue when the screen width is exactly 768px #1073

Closed
ovflowd opened this issue Apr 19, 2020 · 4 comments
Closed

Responsive hide classes issue when the screen width is exactly 768px #1073

ovflowd opened this issue Apr 19, 2020 · 4 comments

Comments

@ovflowd
Copy link

ovflowd commented Apr 19, 2020

Describe the bug

Primer has visibility classes hide-md and hide-lg that goes respectively from the screen sizes 544px to 768px; 768px to 1012px. This seems perfectly reasonable.

The issue that, is not actually part of Primer itself, would happen to suppose the following scenario:

  1. You use both hide-md in one div that should not display on medium screens but it should appear on large screens and another div using hide-lg that should not appear for large screens but should for medium ones.
  2. None of them will appear since the screen has exactly 768px of width.

To Reproduce

Steps to reproduce the behavior:

  1. Implement a snippet for example
    <div class="hide-md hide-sm hide-xl">show on large ONLY</div><div class="hide-lg hide-sm hide-xl">show on medium ONLY</div>
  2. If your screen size is exactly 768px. This will happen. You may be able to test/reproduce by using Developer Tools and set manually your screen size to 768px. If you have an Apple iPad Mini and rotate the screen to portrait this will also happen. Since iPad Mini portrait resolution is exactly 768px.

Expected behavior

The clash of screen sizes should not happen. This is easily solvable by either moving md one pixel less or one-pixel plus.

This may have unattended side effects... Since it could be someone is relying on this condition of 768px.

Screenshots

image
There should be a sidebar on the blue empty background.

image
It should be behaving like this.

You may either check on https://santoro.dev

Desktop (please complete the following information):

  • OS: macOS 10.15.4
  • Browser: Safari
  • Version: 13.2

Additional context

As explained before, this wouldn't probably be considered as a bug part of Primer. Since this is indeed a very edge scenario and may never happen. But maybe it is worth giving a look.

@simurai
Copy link
Contributor

simurai commented Apr 20, 2020

@ovflowd Thanks for reporting. 🙇 What version of Primer CSS are you using? Based on this file path in DevTools it looks like it's 11.0.0?

Screen Shot 2020-04-20 at 2 48 55 PM

This issue was fixed by #746. So updating Primer CSS to 12.2.2 or higher should fix the problem.

@simurai simurai closed this as completed Apr 20, 2020
@ovflowd
Copy link
Author

ovflowd commented Apr 20, 2020

Thanks, @simurai! Going to update my Primer version by just changing that line.

Forgot totally that Primer was being loaded on-demand and not actually being built from sources during the Jekyll build process.

Thank you!

@ovflowd
Copy link
Author

ovflowd commented Apr 20, 2020

I also want to apologize 🤦🙇 that I forgot to search for similar issues before creating this one...

Thanks again!

@simurai
Copy link
Contributor

simurai commented Apr 20, 2020

I also want to apologize 🤦🙇 that I forgot to search for similar issues before creating this one...

No worries.. I still remember running into this bug myself. 😄

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

2 participants