Hello! Here is a fragment from the editor.js
file that I use to generate the CM 6 editor I use:
editor.dispatch({selection: sel});
editor.scrollPosIntoView(offsetLoc.from);
When this code executes executes, the relevant text in the editor scrolls into view and is highlighted
in the sense that its background changes color. I want to set the background color myself.
At the moment the color is set to black, which I do not want. (Some kind of defalt?)
Below is the style info in my theme:
let myTheme = EditorView.theme({
"&": {
color: "#ddd",
backgroundColor: "#303040"
},
"&.cm-highlight": {
backgroundColor: "#a6a"
},
"&.cm-content": {
caretColor: "#0e9",
backgroundColor: "#a6a"
},
"&.cm-focused .cm-cursor": {
borderLeftColor: "#0e9",
highlightColor: "#037ffc"
},
"&.cm-focused .cm-selectionBackground, ::selection": {
backgroundColor: "#e74",
color: "#fff"
},
"&.cm-gutters": {
backgroundColor: "#045",
color: "#ddd",
border: "none"
},
"&.cm-bracket": { color: "#f00" }, // not working // "#f70a0a"
".cm-activeLine": { backgroundColor: "#008c8c"},
"&.cm-selected": { backgroundColor: "#f00"},
}, {dark: true})
PS. When I select something in the editor manually, it is highlighted in orange. This comes the following CSS:
"&.cm-focused .cm-selectionBackground, ::selection": {
backgroundColor: "#e74",
color: "#fff"