web/elements: improve codemirror contrast in dark theme

closes #4622

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer
2023-02-06 11:37:11 +01:00
parent ed01a844ef
commit fd9ce531c9
3 changed files with 26 additions and 8 deletions

View File

@ -11,6 +11,7 @@ import {
} from "@codemirror/language";
import * as yamlMode from "@codemirror/legacy-modes/mode/yaml";
import { Compartment, EditorState, Extension } from "@codemirror/state";
import { oneDark } from "@codemirror/theme-one-dark";
import { EditorView, drawSelection, keymap, lineNumbers } from "@codemirror/view";
import { AKElement } from "@goauthentik/elements/Base";
import YAML from "yaml";
@ -98,14 +99,7 @@ export class CodeMirrorTextarea<T> extends AKElement {
},
{ dark: false },
);
this.themeDark = EditorView.theme(
{
"&": {
backgroundColor: "var(--ak-dark-background-light)",
},
},
{ dark: true },
);
this.themeDark = oneDark;
}
private getInnerValue(): string {