瀏覽代碼

Fix the small offsets in the placement of open menus.

I don’t fully understand everything that is going into the menu position calculation, and in particular our translate to move the menu up so it appears to be continuous with the menu title. There may be a better way to achieve this for both the single-document mode and normal mode. One complication here is that there is an extra border in single-document mode.

One confusing thing to me is the menu panel height is 27px, but the menu items themselves I think are 28px.

Regardless, things look nice now as far as I can tell.
Jason Grout 4 年之前
父節點
當前提交
b7ad9bb4fe
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      packages/application/style/base.css

+ 8 - 2
packages/application/style/base.css

@@ -3,6 +3,10 @@
 | Distributed under the terms of the Modified BSD License.
 |----------------------------------------------------------------------------*/
 
+:root {
+  --jp-private-menu-panel-height: 27px;
+}
+
 .lm-Widget.lm-mod-hidden {
   display: none !important;
 }
@@ -48,7 +52,7 @@ body {
 }
 
 #jp-menu-panel {
-  min-height: 26px;
+  min-height: var(--jp-private-menu-panel-height);
   background: var(--jp-layout-color1);
 }
 
@@ -57,8 +61,10 @@ body {
 }
 
 .jp-LabShell[data-shell-mode='single-document'] #jp-menu-panel {
-  padding-left: 20px;
+  padding-left: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));
   border-bottom: var(--jp-border-width) solid var(--jp-border-color0);
+  /* Adjust min-height so open menus show up in the right place */
+  min-height: calc(var(--jp-private-menu-panel-height) + var(--jp-border-width));
 }
 
 #jp-MainLogo {