diff --git a/extensions/notebook-renderers/src/index.ts b/extensions/notebook-renderers/src/index.ts index d4a9ba9202b..8c0f9033917 100644 --- a/extensions/notebook-renderers/src/index.ts +++ b/extensions/notebook-renderers/src/index.ts @@ -154,7 +154,6 @@ function renderError( contentParent.classList.toggle('word-wrap', e.outputWordWrap); })); contentParent.classList.toggle('scrollable', outputScrolling); - outputElement.classList.toggle('remove-padding', outputScrolling); contentParent.appendChild(content); outputElement.appendChild(contentParent); @@ -232,7 +231,6 @@ function renderStream(outputInfo: OutputItem, outputElement: HTMLElement, error: const outputScrolling = scrollingEnabled(outputInfo, ctx.settings); outputElement.classList.add('output-stream'); - outputElement.classList.toggle('remove-padding', outputScrolling); const text = outputInfo.text(); const content = createOutputContent(outputInfo.id, [text], ctx.settings.lineLimit, outputScrolling, false); @@ -287,7 +285,6 @@ function renderText(outputInfo: OutputItem, outputElement: HTMLElement, ctx: IRi } content.classList.toggle('scrollable', outputScrolling); - outputElement.classList.toggle('remove-padding', outputScrolling); outputElement.appendChild(content); initializeScroll(content, disposableStore); @@ -327,16 +324,28 @@ export const activate: ActivationFunction = (ctx) => { #container div.output_container .word-wrap span { white-space: pre-wrap; } - #container div.output .scrollable { + #container div.output>div { padding-left: var(--notebook-output-node-left-padding); padding-right: var(--notebook-output-node-padding); - overflow-y: scroll; - max-height: var(--notebook-cell-output-max-height); - border-style: solid; box-sizing: border-box; border-width: 1px; + border-style: solid; border-color: transparent; } + #container div.output>div:focus { + outline: 0; + border-color: var(--theme-input-focus-border-color); + } + #container div.output .scrollable { + overflow-y: scroll; + max-height: var(--notebook-cell-output-max-height); + } + #container div.output .scrollable.scrollbar-visible { + border-color: var(--vscode-editorWidget-border); + } + #container div.output .scrollable.scrollbar-visible:focus { + border-color: var(--theme-input-focus-border-color); + } #container div.truncation-message { font-style: italic; font-family: var(--theme-font-family); @@ -351,13 +360,6 @@ export const activate: ActivationFunction = (ctx) => { #container div.output .scrollable.more-above { box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset } - #container div.output .scrollable.scrollbar-visible { - border-color: var(--vscode-editorWidget-border); - } - #container div.output .scrollable.scrollbar-visible:focus{ - outline: 0; - border-color: var(--theme-input-focus-border-color); - } .output-plaintext .code-bold, .output-stream .code-bold, .traceback .code-bold { @@ -383,6 +385,7 @@ export const activate: ActivationFunction = (ctx) => { return { renderOutputItem: async (outputInfo, element, signal?: AbortSignal) => { + element.classList.add('remove-padding'); switch (outputInfo.mime) { case 'text/html': case 'image/svg+xml': { @@ -445,6 +448,10 @@ export const activate: ActivationFunction = (ctx) => { default: break; } + if (element.querySelector('div')) { + element.querySelector('div')!.tabIndex = 0; + } + }, disposeOutputItem: (id: string | undefined) => { if (id) { 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 62d2d92502c..9e02aad41a6 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.ts @@ -337,7 +337,6 @@ export class BackLayerWebView extends Themable { padding-left: var(--notebook-output-node-left-padding); box-sizing: border-box; border-top: none; - border: 1px solid var(--theme-notebook-output-border); } /* markdown */