From 7c069dff35b9165b441b9bd705ffb343f1ff7164 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 23 Jan 2020 10:11:25 +0100 Subject: [PATCH] better codicon alignment in codelens, #87062 --- src/vs/editor/contrib/codelens/codelensController.ts | 8 +++++++- src/vs/editor/contrib/codelens/codelensWidget.css | 4 +--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/vs/editor/contrib/codelens/codelensController.ts b/src/vs/editor/contrib/codelens/codelensController.ts index 21d3b0e81eb..2b4865134c3 100644 --- a/src/vs/editor/contrib/codelens/codelensController.ts +++ b/src/vs/editor/contrib/codelens/codelensController.ts @@ -85,7 +85,13 @@ export class CodeLensContribution implements IEditorContribution { const fontInfo = options.get(EditorOption.fontInfo); const lineHeight = options.get(EditorOption.lineHeight); - const newStyle = `.monaco-editor .codelens-decoration.${this._styleClassName} { height: ${Math.round(lineHeight * 1.1)}px; line-height: ${lineHeight}px; font-size: ${Math.round(fontInfo.fontSize * 0.9)}px; padding-right: ${Math.round(fontInfo.fontSize * 0.45)}px;}`; + + const height = Math.round(lineHeight * 1.1); + const fontSize = Math.round(fontInfo.fontSize * 0.9); + const newStyle = ` + .monaco-editor .codelens-decoration.${this._styleClassName} { height: ${height}px; line-height: ${lineHeight}px; font-size: ${fontSize}px; padding-right: ${Math.round(fontInfo.fontSize * 0.45)}px;} + .monaco-editor .codelens-decoration.${this._styleClassName} > a > .codicon { line-height: ${lineHeight}px; font-size: ${fontSize}px; } + `; this._styleElement.innerHTML = newStyle; } diff --git a/src/vs/editor/contrib/codelens/codelensWidget.css b/src/vs/editor/contrib/codelens/codelensWidget.css index 330626bef39..7bd66d08fd8 100644 --- a/src/vs/editor/contrib/codelens/codelensWidget.css +++ b/src/vs/editor/contrib/codelens/codelensWidget.css @@ -27,9 +27,7 @@ } .monaco-editor .codelens-decoration .codicon { - line-height: inherit; - font-size: 110%; - vertical-align: inherit; + vertical-align: middle; color: currentColor !important; } -- GitLab