diff --git a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css index c9512232cd3..d79f11d4ce1 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css +++ b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.css @@ -10,8 +10,6 @@ .suggest-input-container .monaco-editor-background, .suggest-input-container .monaco-editor, .suggest-input-container .mtk1 { - /* allow the embedded monaco to be styled from the outer context */ - background-color: transparent; color: inherit; } @@ -25,4 +23,3 @@ margin-top: 2px; margin-left: 1px; } - diff --git a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts index b7f1355fdad..b9731888148 100644 --- a/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts +++ b/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.ts @@ -224,7 +224,8 @@ export class SuggestEnabledInput extends Widget implements IThemable { public style(colors: ISuggestEnabledInputStyles): void { - this.stylingContainer.style.backgroundColor = colors.inputBackground ? colors.inputBackground.toString() : ''; + this.placeholderText.style.backgroundColor = + this.stylingContainer.style.backgroundColor = colors.inputBackground ? colors.inputBackground.toString() : ''; this.stylingContainer.style.color = colors.inputForeground ? colors.inputForeground.toString() : null; this.placeholderText.style.color = colors.inputPlaceholderForeground ? colors.inputPlaceholderForeground.toString() : null; @@ -254,7 +255,7 @@ export class SuggestEnabledInput extends Widget implements IThemable { public layout(dimension: Dimension): void { this.inputWidget.layout(dimension); - this.placeholderText.style.width = `${dimension.width}px`; + this.placeholderText.style.width = `${dimension.width - 2}px`; } private selectAll(): void { @@ -286,6 +287,12 @@ registerThemingParticipant((theme, collector) => { if (inputForegroundColor) { collector.addRule(`.suggest-input-container .monaco-editor .view-line span.inline-selected-text { color: ${inputForegroundColor}; }`); } + + const backgroundColor = theme.getColor(inputBackground); + if (backgroundColor) { + collector.addRule(`.suggest-input-container .monaco-editor-background { background-color: ${backgroundColor}; } `); + collector.addRule(`.suggest-input-container .monaco-editor { background-color: ${backgroundColor}; } `); + } });