From a4ad395f23ab80d535730574c3ac82b84c779d72 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 9 Nov 2021 14:22:47 -0800 Subject: [PATCH] Increase default markup font size For #126294 --- extensions/markdown-language-features/notebook/index.ts | 4 ---- .../contrib/notebook/browser/notebook.contribution.ts | 2 +- .../notebook/browser/view/renderers/backLayerWebView.ts | 2 +- src/vs/workbench/contrib/notebook/common/notebookOptions.ts | 4 ++-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/extensions/markdown-language-features/notebook/index.ts b/extensions/markdown-language-features/notebook/index.ts index 2586457e2c2..342fa97a954 100644 --- a/extensions/markdown-language-features/notebook/index.ts +++ b/extensions/markdown-language-features/notebook/index.ts @@ -29,10 +29,6 @@ export const activate: ActivationFunction = (ctx) => { const style = document.createElement('style'); style.textContent = ` - #preview { - font-size: 1.1em; - } - .emptyMarkdownCell::before { content: "${document.documentElement.style.getPropertyValue('--notebook-cell-markup-empty-content')}"; font-style: italic; diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts index d70cb4a6b1b..5616612cf15 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -781,7 +781,7 @@ configurationRegistry.registerConfiguration({ tags: ['notebookLayout'] }, [NotebookSetting.markupFontSize]: { - markdownDescription: nls.localize('notebook.markup.fontSize', "Controls the font size of rendered markup in notebooks. When set to `0`, the value of `#editor.fontSize#` is used."), + markdownDescription: nls.localize('notebook.markup.fontSize', "Controls the font size of rendered markup in notebooks. When set to `0`, 120% `#editor.fontSize#` is used."), type: 'number', default: 0, tags: ['notebookLayout'] diff --git a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts index d4e31753528..4697b6c5cd2 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts @@ -221,7 +221,7 @@ export class BackLayerWebView extends Disposable { 'notebook-markdown-left-margin': `${this.options.markdownLeftMargin}px`, 'notebook-output-node-left-padding': `${this.options.outputNodeLeftPadding}px`, 'notebook-markdown-min-height': `${this.options.previewNodePadding * 2}px`, - 'notebook-markup-font-size': `${this.options.markupFontSize}px`, + 'notebook-markup-font-size': typeof this.options.markupFontSize === 'number' && this.options.markupFontSize > 0 ? `${this.options.markupFontSize}px` : `calc(${this.options.fontSize}px * 1.2)`, 'notebook-cell-output-font-size': `${this.options.fontSize}px`, 'notebook-cell-markup-empty-content': nls.localize('notebook.emptyMarkdownPlaceholder', "Empty markdown cell, double click or press enter to edit."), 'notebook-cell-renderer-not-found-error': nls.localize({ diff --git a/src/vs/workbench/contrib/notebook/common/notebookOptions.ts b/src/vs/workbench/contrib/notebook/common/notebookOptions.ts index 1c848245cac..040cedd0bd6 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookOptions.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookOptions.ts @@ -156,7 +156,7 @@ export class NotebookOptions extends Disposable { insertToolbarAlignment, showFoldingControls, fontSize, - markupFontSize: markupFontSize > 0 ? markupFontSize : fontSize, + markupFontSize, editorOptionsCustomizations, }; @@ -267,7 +267,7 @@ export class NotebookOptions extends Disposable { } if (markupFontSize) { - configuration.markupFontSize = this.configurationService.getValue(NotebookSetting.markupFontSize) || configuration.fontSize; + configuration.markupFontSize = this.configurationService.getValue(NotebookSetting.markupFontSize); } if (editorOptionsCustomizations) {