-
Notifications
You must be signed in to change notification settings - Fork 508
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(client): sticky header leaves 1px gap on top #11644
base: main
Are you sure you want to change the base?
Conversation
I was able to reproduce in BrowserStack Live at 1920x970 on Windows 11 with Chrome 128 consistently at zoom level 75% (but not at 67% / 80% / 90%), and with Firefox 130 once at zoom level 67% (but not at other zoom levels). The |
Co-authored-by: Claas Augner <[email protected]>
@@ -355,7 +355,7 @@ sup.new { | |||
|
|||
.sticky-header-container { | |||
position: sticky; | |||
top: 0; | |||
top: -0.1px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
top: -0.1px; | |
top: -1px; |
The -0.1px
doesn't work on Firefox developer 131.0b9 (64-bit) at 300% zoom on Linux Mint 22 x86_64:
zoomIssue.mp4
It's a rounding error, so it is better to use a complete pixel.
Summary
Depending on the zoom level, the
sticky-header-container
leaves a 1px gap on the top.Problem
Refer to the following video:
stiky_header_1px_gap.mp4
Note that the viewport's top border has white dots.
Make sure you have the dark theme on. If you can not reproduce it, change the browser zoom level slightly and scroll so that some text reaches the top border of the viewport. Keep changing zoom till you see the gap. I can reproduce this in Firefox and Chrome.
Solution
This is due to some zoom levels producing fractions in the header dimensions, so a 1px gap remains after rounding. Pulling the header 1px up by using
top: -1px
should cover the gap.How did you test this change?
In a browser before and after the fix.