Skip to content

Commit 5330886

Browse files
author
Miguel Solorio
committed
Reduce whitespace in notebook cells (refs microsoft#101600)
1 parent a564c95 commit 5330886

3 files changed

Lines changed: 17 additions & 20 deletions

File tree

src/vs/workbench/contrib/notebook/browser/constants.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
export const SCROLLABLE_ELEMENT_PADDING_TOP = 20;
99

1010
// Cell sizing related
11-
export const CELL_MARGIN = 24;
12-
export const CELL_RUN_GUTTER = 32;
13-
export const CODE_CELL_LEFT_MARGIN = 45;
11+
export const CELL_MARGIN = 16;
12+
export const CELL_RUN_GUTTER = 28;
13+
export const CODE_CELL_LEFT_MARGIN = 44;
1414

1515
export const EDITOR_TOOLBAR_HEIGHT = 0;
16-
export const BOTTOM_CELL_TOOLBAR_HEIGHT = 32;
16+
export const BOTTOM_CELL_TOOLBAR_HEIGHT = 28;
1717
export const CELL_STATUSBAR_HEIGHT = 22;
1818

1919
// Margin above editor
20-
export const EDITOR_TOP_MARGIN = 8;
21-
export const CELL_BOTTOM_MARGIN = 8;
20+
export const EDITOR_TOP_MARGIN = 6;
21+
export const CELL_BOTTOM_MARGIN = 6;
2222

2323
// Top and bottom padding inside the monaco editor in a cell, which are included in `cell.editorHeight`
2424
export const EDITOR_TOP_PADDING = 12;

src/vs/workbench/contrib/notebook/browser/media/notebook.css

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@
356356

357357
.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell .run-button-container .monaco-toolbar .codicon {
358358
margin: 0;
359-
padding: 0 4px;
359+
padding-right: 4px;
360360
}
361361

362362
.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell .run-button-container .monaco-toolbar .actions-container {
@@ -623,7 +623,7 @@
623623

624624
/* Adjust margin of first item in markdown cell */
625625
.monaco-workbench .notebookOverlay .cell.markdown div *:first-child {
626-
margin-top: 4px;
626+
margin-top: 0px;
627627
}
628628

629629
/* h1 tags don't need top margin */
@@ -632,18 +632,15 @@
632632
}
633633

634634
/* Removes bottom margin when only one item exists in markdown cell */
635-
.monaco-workbench .notebookOverlay .cell.markdown div h1:only-child,
636-
.monaco-workbench .notebookOverlay .cell.markdown div h2:only-child,
637-
.monaco-workbench .notebookOverlay .cell.markdown div h3:only-child,
638-
.monaco-workbench .notebookOverlay .cell.markdown div h1:last-child,
639-
.monaco-workbench .notebookOverlay .cell.markdown div h2:last-child,
640-
.monaco-workbench .notebookOverlay .cell.markdown div h3:last-child {
635+
.monaco-workbench .notebookOverlay .cell.markdown div *:only-child,
636+
.monaco-workbench .notebookOverlay .cell.markdown div *:last-child {
641637
margin-bottom: 0;
638+
padding-bottom: 0;
642639
}
643640

644641
/* makes all markdown cells consistent */
645642
.monaco-workbench .notebookOverlay .cell.markdown div {
646-
min-height: 32px;
643+
min-height: 24px;
647644
}
648645

649646
.monaco-workbench .notebookOverlay .cell.markdown table {
@@ -711,15 +708,16 @@
711708

712709
.monaco-workbench .notebookOverlay > .cell-list-container .notebook-folding-indicator {
713710
position: absolute;
714-
top: 11px;
715-
left: 0px;
711+
top: 0;
712+
left: 0;
716713
right: 0;
714+
height: 100%;
717715
}
718716

719717
.monaco-workbench .notebookOverlay > .cell-list-container .notebook-folding-indicator .codicon {
720718
visibility: visible;
721-
padding: 4px;
722-
width: calc(100% - 30px);
719+
padding: 8px 4px 0;
720+
width: calc(100% - 32px);
723721
}
724722

725723
/** Theming */

src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,6 @@ registerThemingParticipant((theme, collector) => {
15661566
collector.addRule(`.notebookOverlay .output { width: calc(100% - ${CODE_CELL_LEFT_MARGIN + CELL_RUN_GUTTER + CELL_MARGIN}px); }`);
15671567
collector.addRule(`.notebookOverlay .cell-bottom-toolbar-container { width: calc(100% - ${CELL_MARGIN * 2 + CELL_RUN_GUTTER}px); margin: 0px ${CELL_MARGIN}px 0px ${CELL_MARGIN + CELL_RUN_GUTTER}px; }`);
15681568

1569-
collector.addRule(`.notebookOverlay .markdown-cell-row .cell .cell-editor-part { margin-left: ${CELL_RUN_GUTTER}px; }`);
15701569
collector.addRule(`.notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row > div.cell.markdown { padding-left: ${CELL_RUN_GUTTER}px; }`);
15711570
collector.addRule(`.notebookOverlay .cell .run-button-container { width: ${CELL_RUN_GUTTER}px; }`);
15721571
collector.addRule(`.notebookOverlay .cell-drag-image .cell-editor-container > div { padding: ${EDITOR_TOP_PADDING}px 16px ${EDITOR_BOTTOM_PADDING}px 16px; }`);

0 commit comments

Comments
 (0)