From 2432e519701926d2e6cc9e03fde1fa52e9cfcd7e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 8 Jul 2022 22:55:57 +0200 Subject: [PATCH] web/elements: improve contrast for codemirror backgrounds Signed-off-by: Jens Langhammer --- web/src/elements/CodeMirror.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/web/src/elements/CodeMirror.ts b/web/src/elements/CodeMirror.ts index b2a062767..a1ec1260a 100644 --- a/web/src/elements/CodeMirror.ts +++ b/web/src/elements/CodeMirror.ts @@ -85,8 +85,22 @@ export class CodeMirrorTextarea extends LitElement { constructor() { super(); this.theme = new Compartment(); - this.themeLight = EditorView.theme({}, { dark: false }); - this.themeDark = EditorView.theme({}, { dark: true }); + this.themeLight = EditorView.theme( + { + "&": { + backgroundColor: "var(--pf-global--BackgroundColor--light-300)", + }, + }, + { dark: false }, + ); + this.themeDark = EditorView.theme( + { + "&": { + backgroundColor: "var(--ak-dark-background-light)", + }, + }, + { dark: true }, + ); } private getInnerValue(): string {