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

Side bar rendering broken at width of exactly 1024px #297

Open
wpbrown opened this issue Sep 11, 2018 · 3 comments
Open

Side bar rendering broken at width of exactly 1024px #297

wpbrown opened this issue Sep 11, 2018 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@wpbrown
Copy link

wpbrown commented Sep 11, 2018

Configuration

  • Operating system with its version: Windows 10
  • Browser with its version: Firefox 61.0.2
  • Hugo version: 0.46
  • Tranquilpeak version: 0.4.3-BETA and 0.4.4-BETA
  • Do you reproduce on https://tranquilpeak.kakawait.com demo?: Yes

Actual behavior

Side bar renders without background and misalignment.

screenshot of broken behavior

Expected behavior

Side bar transition from collapsed to expanded.

Steps to reproduce the behavior

Size browser to 1024.

@wpbrown
Copy link
Author

wpbrown commented Sep 26, 2018

Upon further investigation, this seems to be a general problem with CSS reference pixels vs device pixels. This only happens on my 4K display where I have OS display scaling at 175%. If I slide the window over to my 1080P display with 100% scaling, all window sizes work properly.

The only work around I've found so far is to carefully add 1px overlap to the media queries and make sure when both queries are matching that everything cascades properly and the final computed properties are as they should be. It feels hacky and I haven't gotten it fully working yet, but getting close.

Edit: Found this discussion of the exact problem:
http://damienclarke.me/code/posts/those-1px-gaps-between-media-queries-can-be-a-problem

Unlike at the time of that writing, it seems Chrome is affected too. Edge, Chrome, and Firefox all using fractional pixels in media query evaluation.

wpbrown added a commit to wpbrown/hugo-tranquilpeak-theme that referenced this issue Sep 26, 2018
Works around issue: kakawait#297

Use fractional pixels to prevent gap in media query coverage.
@kakawait
Copy link
Owner

kakawait commented Jul 13, 2019

@wpbrown I saw that you find a workaround. Could you please share the code you did it (not minified/concated version)?

I don't have 4K display unfortunately so it will be hard for me to debug it without your help

@kakawait kakawait added good first issue Good for newcomers ideal for contribution An issue that a contributor can help us with waiting for feedback We need additional information before we can continue labels Jul 13, 2019
@wpbrown
Copy link
Author

wpbrown commented Jul 13, 2019

You don't necessarily need a high DPI display, you just need to up your display to a fractional scaling value like 125%. I honestly don't know what I was thinking 10 months ago. Seems crazy that I wouldn't have updated the unmodified source too, but it sure looks that way 😸 I'll see if I can figure out what I did.

@kakawait kakawait removed the waiting for feedback We need additional information before we can continue label Mar 30, 2020
@kakawait kakawait added help wanted Extra attention is needed bug Something isn't working and removed ideal for contribution An issue that a contributor can help us with good first issue Good for newcomers labels Aug 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants