YamlEditor: fix dark-mode cursor visibility and selection contrast (#30978)
This commit is contained in:
parent
1056e85af2
commit
d62ccfe3df
2 changed files with 12 additions and 4 deletions
|
|
@ -73,7 +73,7 @@ export default {
|
|||
height: 100%;
|
||||
font-size: 13px;
|
||||
background-color: var(--evcc-box);
|
||||
color: var(--bs-body-color);
|
||||
color: var(--evcc-default-text);
|
||||
}
|
||||
.editor :global(.cm-editor.cm-focused) {
|
||||
outline: none;
|
||||
|
|
@ -93,11 +93,11 @@ export default {
|
|||
background-color: transparent;
|
||||
}
|
||||
.editor :global(.cm-cursor) {
|
||||
border-left-color: var(--bs-body-color);
|
||||
border-left-color: var(--evcc-default-text) !important;
|
||||
}
|
||||
.editor :global(.cm-selectionBackground),
|
||||
.editor :global(.cm-focused .cm-selectionBackground) {
|
||||
background-color: var(--evcc-gray-50);
|
||||
background-color: rgba(128, 128, 128, 0.4) !important;
|
||||
}
|
||||
.editor :global(.cm-errorLine) {
|
||||
background-color: var(--bs-danger) !important;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
// Separate module so YamlEditor.vue can dynamic-import it, keeping CodeMirror out of the main chunk.
|
||||
import { EditorState, Compartment, StateField, StateEffect } from "@codemirror/state";
|
||||
import { EditorView, lineNumbers, keymap, Decoration, type DecorationSet } from "@codemirror/view";
|
||||
import {
|
||||
EditorView,
|
||||
lineNumbers,
|
||||
keymap,
|
||||
drawSelection,
|
||||
Decoration,
|
||||
type DecorationSet,
|
||||
} from "@codemirror/view";
|
||||
import {
|
||||
indentOnInput,
|
||||
foldGutter,
|
||||
|
|
@ -71,6 +78,7 @@ export function createEditor(opts: EditorOptions): EditorController {
|
|||
extensions: [
|
||||
lineNumbers(),
|
||||
foldGutter(),
|
||||
drawSelection(),
|
||||
history(),
|
||||
bracketMatching(),
|
||||
yaml(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue