From cfcd74051ef915d830352685e578d7ac858dc2a5 Mon Sep 17 00:00:00 2001 From: Dipta Mahardhika <146386738+d-mahard@users.noreply.github.com> Date: Fri, 10 May 2024 19:41:15 +0200 Subject: [PATCH] ui: change line decoration color to use vscode theme (#1253) * ui: change line decoration color to use vscode theme to give user a more consistent experience by letting the decoration color to user the color defined in the theme. * fix: incorrect color item should be line background not text background because the decoration is for the whole line --- .../vscode/src/diff/verticalPerLine/decorations.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/extensions/vscode/src/diff/verticalPerLine/decorations.ts b/extensions/vscode/src/diff/verticalPerLine/decorations.ts index fa6e70baf..276145207 100644 --- a/extensions/vscode/src/diff/verticalPerLine/decorations.ts +++ b/extensions/vscode/src/diff/verticalPerLine/decorations.ts @@ -2,15 +2,21 @@ import * as vscode from "vscode"; export const redDecorationType = vscode.window.createTextEditorDecorationType({ isWholeLine: true, - backgroundColor: "rgba(255, 0, 0, 0.2)", - color: "rgb(200, 200, 200)", + backgroundColor: { id: "diffEditor.removedLineBackground" }, + color: "#808080", + outlineWidth: "1px", + outlineStyle: "solid", + outlineColor: { id: "diffEditor.removedTextBorder" }, rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed, }); export const greenDecorationType = vscode.window.createTextEditorDecorationType( { isWholeLine: true, - backgroundColor: "rgba(0, 255, 0, 0.2)", + backgroundColor: { id: "diffEditor.insertedLineBackground" }, + outlineWidth: "1px", + outlineStyle: "solid", + outlineColor: { id: "diffEditor.insertedTextBorder" }, rangeBehavior: vscode.DecorationRangeBehavior.ClosedClosed, }, );