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
Decrease top menu padding for high zoom / narrow screen #16044
base: main
Are you sure you want to change the base?
Decrease top menu padding for high zoom / narrow screen #16044
Conversation
Thanks for making a pull request to jupyterlab! |
/* TODO: remove ignore directive when fixed: https://github.com/csstree/csstree/issues/164 */ | ||
/* stylelint-disable-next-line csstree/validator */ | ||
padding: 0 min(calc(4vw - 11.2px), 8px); /* The use of min(), calc() and vw units | ||
has the effect that as the screen drops below 480px, horizontal padding will |
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.
Note: 480px was chosen through trial and error. At around 420px with 8px padding between menu items, the menu bar starts to be too wide for the screen width. 480px gives a little wiggle room.
This gave two equations to solve:
(480px)a + b = 8px
(320px)a + b = 1.5px
Because at 320px, the padding needs to be set to 1.5px for the items to fit. Solving the equations gives:
a ~= 0.04 (equivalent to 4vw)
b ~= -11.2px
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.
I hesitated to review this PR because I am moderately against this change, but since no one else had left a review, here we go:
Among all the changes in #15855, this one appears to me to be the most controversial, because it fixes one accessibility issue (visibility of options at 400% zoom) by introducing another accessibility issue (too small tap targets).
I think this issue would be better solved by making use of the hamburger menu. While it is a tricky thing to get right, there was already a lot of effort put into it:
Another thought is that it does not really solve the problem when:
|
References
PR #15855.
This is the first of a series of PRs breaking up #15855 into individual CSS changes, with the hope that this will make it easier to tackle the issues that we've been having with Playwright Galata snapshot testing.
Code changes
Updates the padding rule for the
.lm-MenuBar-item
CSS selector so that menu bar items will all fit within narrow or zoomed-in screens.User-facing changes
See above.
Backwards-incompatible changes
n/a
How to test
Load JupyterLab. Drag window wide, drag window narrow. Observe how it affects padding in the menu bar. At 480px, padding should start to decrease. At 320px, the top menu bar items (File, Edit, View, Run, Kernel, Tabs, Settings, Help) will be scrunched together but should all be visible, as the following screenshot shows:
Alternatively, set your browser window to 1280px, then zoom in to 400%. Again, the menu items will be tightly spaced but should fit within the width of your browser window.