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

Decrease top menu padding for high zoom / narrow screen #16044

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/application/style/menus.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
}

.lm-MenuBar-item {
padding: 0 8px;
/* 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
Copy link
Contributor Author

@gabalafou gabalafou Mar 23, 2024

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

steadily decrease so that the standard menu items fit in a 320px wide screen
(equivalent to zooming to 400% from 1280px) */
border-left: var(--jp-border-width) solid transparent;
border-right: var(--jp-border-width) solid transparent;
border-top: var(--jp-border-width) solid transparent;
Expand Down